gpt4 book ai didi

swift - 在 Swift 中集成 Sinch 库时出错?

转载 作者:行者123 更新时间:2023-11-28 14:06:13 25 4
gpt4 key购买 nike

我有自己的应用程序来集成 Sinch 以进行视频通话。我的大错误是当用户 A 调用用户 B,用户 C 和所有其他用户也收到来电通知(用户 B 和 C 的应用程序都是后台)。这是我获取本地通知的代码。在 callheaders 中,我传递了 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 相同(如果是)!您需要显示视频通话通知,如果没有,请忽略此通知!

关于swift - 在 Swift 中集成 Sinch 库时出错?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52960225/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com