swift - 未调用 reportNewIncomingCall 完成

标签 swift voip callkit

reportNewIncomingCall没有调用完成参数,这意味着我没有收到关于为什么我的 VOIP 应用程序没有显示调用接收警报的任何反馈。

    func reportIncomingCall(uuid: UUID, handle: String, hasVideo: Bool = false, completion: ((NSError?) -> Void)?) {
    // 1.
    let update = CXCallUpdate()
    update.remoteHandle = CXHandle(type: .phoneNumber, value: handle)
    update.hasVideo = hasVideo

    // 2.
    provider.reportNewIncomingCall(with: uuid, update: update) { error in
        if error == nil {
            // 3.
            let call = Call(uuid: uuid, handle: handle)
            self.callManager.add(call: call)
        }

        // 4.
        completion?(error as? NSError)
    }
}

我是从 Ray Wanderlich tutorial 中获取的.

我尽可能准确地复制了代码。它在教程中有效,但在我的项目中无效。

最佳答案

enter image description here

这是我没有做的......这解决了它。

关于swift - 未调用 reportNewIncomingCall 完成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55737315/

相关文章:

ios - 如何让 Facebook 的自定义登录显示在我的 Main.storyboard 上,而不仅仅是在我的代码中

ios - 计算IOS中的哈希率

swift - 从 php 脚本发送时未收到 VoIP 推送通知

ios - 带有 dataTaskWithRequest 的 NSURLSession 仅在应用程序启动时触发,而不是在应用程序未运行时触发

ios - 来自 native 调用 UI 的 VOIP 去电

ios - 为 VOIP 应用程序自定义 iPhone Callkit 调用屏幕

swift - CGContextSetLineDash 警告

ios - 使用 Swift 和 Storyboard 在动态 TableViewCell 中创建 UILabels

带有推送套件的 IOS voip 应用程序

ios - 以编程方式检查 iOS 是否支持 CallKit API