swift - 未调用 reportNewIncomingCall 完成
问题描述
没有调用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 教程中获取的。
我尽可能准确地复制了代码。它适用于本教程,但不适用于我的项目。
解决方案
推荐阅读
- javascript - 文本对齐“中心”不适用于表头
- node.js - 有没有办法在 Dialogflow 中检索对话历史记录?
- javascript - 将录音保存在文件夹中
- apache-kafka-connect - 重新启动 kafka 连接接收器和源连接器以从头开始读取
- python - 如何在 ROS 中订阅和发布图片
- python-3.6 - 为什么 Python 日志记录模块会抛出属性错误?
- javascript - 为什么两次应用相同的数据会破坏图表?
- django - 如何正确更改 Django FileField.upload_to 属性?
- java - Java使用字节数组列表创建nativequery
- ruby-on-rails - 在 Ruby on Rails 中使用 wicked_pdf gem 时如何删除书签?