Hippo Call Client
- Hippo Chat - 检查 Hippo 消息功能以及视频和音频通话
安装
CocoaPods
确保您正在运行最新版本的 CocoaPods,通过运行以下命令来完成
gem install cocoapods
# (or if the above fails)
sudo gem install cocoapods
通过运行以下命令来更新您的本地规范仓库
pod repo update
注意: 此步骤是可选的,如果您最近已更新规范仓库。
将以下行添加到您的 Podfile 中
pod 'HippoCallClient'
运行 pod install
,然后您就设置完成了!
步骤
1. 初始化 HippoCallClient SDK
通过设置 Turn 和 Stun 服务器凭据来初始化客户端
请在 didFinishLaunchingWithOptions 中添加以下内容
HippoCallClient.shared.setCredentials(rawCredentials: <Raw credential json>)
2. 分配 HippoCallClient 协议
您必须将 HippoCallClientDelegate 分配给类,然后将其设置到 "HippoCallClient.shared.registerHippoCallClient" 函数中,在 "didFinishLaunchingWithOptions" 和 "didReceiveIncomingPushWith"
func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, forType type: PKPushType) {
HippoCallClient.shared.registerHippoCallClient"(delegate: < HippoCallClientDelegate >)
}
3. 最后开始通话
要开始通话,函数
HippoCallClient.shared.startCall(call: Call, completion: @escaping (Bool) -> Void)
其中 "Call" 是 SDK 类,创建变量并将其传递到上述函数
: create object by:
Call.init(peer: <CallPeer>, signalingClient: <SignalingClient>, uID: <String>, currentUser: <CallPeer>, type: <CallType>)
Voip 通知接收
收到 Voip 通知时调用该函数
HippoCallClient.shared.voipNotificationRecieved(dictionary: [AnyHashable: Any], peer: <CallPeer>, signalingClient: <SignalingClient>, currentUser: <CallPeer>)"
提供反馈
HippoCallClient SDK 尚处于开发中,我们很乐意听取您对其的看法和反馈。