Kustomer Chat iOS SDK
使用我们的 iOS 聊天 SDK 将Kustomer嵌入您自己的产品中。
文档和指南
要求
- Kustomer.com API密钥(《如何获取API密钥》)
- Xcode 12.0+
- iOS 11.0+
安装
注意:从iOS版本2.6.0开始,如果使用Swift Package Manager或Cocoapods安装SDK,PubNub库将作为依赖项下载。
Swift包管理器
- 在Xcode中创建或打开项目
- 转到文件 > Swift包 > 添加包依赖
- 在URL字段中输入 https://github.com/kustomer/kustomer-ios
- 使用从2.0.0 < 3.0.0的Next Major Version规则,然后点击下一步按钮
Cocoapods
- 将
pod 'KustomerChat', :git => 'https://github.com/kustomer/kustomer-ios.git'
添加到你的Podfile中 - 在你的项目中运行
pod update
或pod install
手动
- 将
KustomerChat.xcframework
添加到项目的框架、库和嵌入式内容
部分。 - 为两个框架检查
嵌入并签名
- 使用您首选的方法添加PubNub。您可以在其文档中找到详细信息这里
CALL OUT: 如果你将PubNub作为git子模块添加,你必须安装我们podspec/package.swift所需的PubNub版本。
用户手册 - 静态版本
每个版本的发布页面都包含SDK的静态版本。要安装,请下载并解压缩 libKustomerChatStatic.xcframework
和 KustomerAssets.bundle
,并将它们添加到您的项目中。您还需要安装podspec/package.swift中所需版本的PubNub。您可以在他们的文档这里找到详细信息。
安装后
- 将照片和相机隐私描述添加到您的
Info.plist
- 在您的
AppDelegate
中的application(_:didFinishLaunchingWithOptions:)
方法中添加
Kustomer.configure(apiKey: "API_KEY_HERE", options: nil, launchOptions: launchOptions)
- 无论何时何地,只要你想打开Kustomer聊天界面,就调用
Kustomer.show()
有关完整指南,请参阅安装
示例应用
- 打开
Example/Example.xcodeproj
- 在
AppDelegate.swift
中设置您的API密钥- 您的API密钥必须只有仅有的
org.tracking
角色。您可以从Kustomer网站上获取您的API密钥。
- 您的API密钥必须只有仅有的
- 运行应用程序