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拿走这个。
我尽可能准确地复制了代码。它适用于教程,但不适用于我的项目。