在 Swift 中集成 Sinch 库时出错?
Error when integrate Sinch library in Swift?
我有自己的应用程序来集成 Sinch 以调用视频。我的大错误是当用户 A 呼叫用户 B,用户 C 和所有其他用户也收到来电通知(用户 B 和 C 的应用程序都是后台)。
这是我获取本地通知的代码。在call
的headers
中,我传递了3个参数:远程用户id、来电者姓名和来电者头像。我尝试打印出来,但它显示 nil
。我认为解决方案是将当前用户 ID 设置为远程用户 ID,但我无法从 headers
获得任何信息,请告诉我如何解决此问题。
func client(_ client: SINCallClient!, localNotificationForIncomingCall call: SINCall!) -> SINLocalNotification! {
print("notificationcall \(call?.headers)")
let notification = SINLocalNotification()
notification.alertBody = "Cuộc gọi call video"
notification.soundName = UILocalNotificationDefaultSoundName
return notification
}
在 didReceiveIncomingPushWithPayload 中,您需要从 header 获取 remoteId,并在 handleRemoteNotification 中检查 localUser 是否与 remoteId 相同(如果是)!您需要显示视频通话通知,如果没有请忽略此通知!
我有自己的应用程序来集成 Sinch 以调用视频。我的大错误是当用户 A 呼叫用户 B,用户 C 和所有其他用户也收到来电通知(用户 B 和 C 的应用程序都是后台)。
这是我获取本地通知的代码。在call
的headers
中,我传递了3个参数:远程用户id、来电者姓名和来电者头像。我尝试打印出来,但它显示 nil
。我认为解决方案是将当前用户 ID 设置为远程用户 ID,但我无法从 headers
获得任何信息,请告诉我如何解决此问题。
func client(_ client: SINCallClient!, localNotificationForIncomingCall call: SINCall!) -> SINLocalNotification! {
print("notificationcall \(call?.headers)")
let notification = SINLocalNotification()
notification.alertBody = "Cuộc gọi call video"
notification.soundName = UILocalNotificationDefaultSoundName
return notification
}
在 didReceiveIncomingPushWithPayload 中,您需要从 header 获取 remoteId,并在 handleRemoteNotification 中检查 localUser 是否与 remoteId 相同(如果是)!您需要显示视频通话通知,如果没有请忽略此通知!