使用 iOS13,是否允许在收到 VoIP 推送时报告 CXCallUpdate 或 CXEndCallAction?

With iOS13, is it allowed to report CXCallUpdate or CXEndCallAction when a VoIP Push is received?

我想知道是否允许在接收到VoIP Push时在下面的方法中报告CXCallUpdateCXEndCallAction

func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, forType type: PKPushType) {
  // report new incoming call
}

官方文档只提到在该块中报告 newNewIncomingCall here。这里是文档的相关部分。

When linking against the iOS 13 SDK or later, your implementation of this method must report notifications of type voIP to the CallKit framework by calling the reportNewIncomingCall(with:update:completion:) method of your app's CXProvider object.

在此先感谢您的帮助。

您可能知道,在 iOS 13 及之后,您必须在收到 VoIP 推送时向 CallKit 报告呼叫。但是,一旦您报告了呼叫并且只要呼叫保持活动状态,您就可以接收任意数量的 VoIP 推送并在 pushRegistry(:didReceiveIncomingPushWith:type:).

内做任何您想做的事情

Apple官方文档网站上似乎刚刚更新了描述应如何处理VoIP推送的相关文档。

它说除了传入呼叫外,不要向应用程序发送任何其他 VoIP 推送,这意味着一旦收到 VoIP 推送,我们就无法报告 CXCallUpdate 或 CXEndCallAction。

文档的相关部分见下方

发送初始推送通知后,不要发送额外的推送通知来取消通话或向您的应用传达新的详细信息。相反,直接通过您在应用程序和服务器之间建立的网络连接与应用程序通信。使用现有网络连接通常比发送推送通知更快,如果网络状况不佳,APNs 可能无法向设备发送推送通知。

这里还有刚刚更新的官方文档

https://developer.apple.com/documentation/pushkit/responding_to_voip_notifications_from_pushkit?language=objc