ios - 当应用程序处于非活动终止状态时,带有 CallKit 的 VOIP 通知不会调用 reportIncomingCall
问题描述
这是一个视频通话应用程序。我已经实施了 VoIP 通知来接收视频通话。在收到 VoIP 通知时,我正在使用 CallKit 拨打电话reportNewIncomingCall()
。
当我最小化应用程序时,我收到来电并且流程正常。但是当我杀死应用程序时,我没有接到来电。知道为什么吗?我还注意到,当我下次点击并打开应用程序时,它会崩溃:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Killing app because it never posted an incoming call to the system after receiving a PushKit VoIP push callback.'
这表示我没有发布reportNewIncomingCall
。但是我已经在做它并在应用程序最小化时接到电话。
func pushRegistry(_ registry: PKPushRegistry,
didReceiveIncomingPushWith payload: PKPushPayload,
for type: PKPushType,
completion: @escaping () -> Void) {
provider.reportNewIncomingCall(with: uuid, update: update) { error in
}
completion()
}
只有在被杀死的状态下,我没有接到电话。要在终止状态下接听电话,还需要做什么?请帮忙。
解决方案
您是否尝试在完成处理程序中调用pushRegistry
完成处理reportNewIncomingCall
程序?
func pushRegistry(_ registry: PKPushRegistry,
didReceiveIncomingPushWith payload: PKPushPayload,
for type: PKPushType,
completion: @escaping () -> Void) {
provider.reportNewIncomingCall(with: uuid, update: update) { error in
completion() // <----
}
}
即使文档中不清楚,我认为这是处理新来电的正确方法。
推荐阅读
- typescript - 扩展外部接口
- azure - 无法删除 Azure Active Directory 自定义域
- file-io - SAS Infile 语句分隔符
- azure-devops - Azure DevOps PublishPipelineArtifact 在失败时未运行
- java - Springboot线程数不断增加
- javascript - Selectpicker(引导选择)不起作用,显示禁用的菜单?
- python - 循环显示正确答案为不正确
- php - 类型提示和多个接口
- python - pandas 自动迭代行并连接结果?
- javascript - 事件侦听器即使在 chrome 上也不起作用?