Apple PushKit didUpdatePushCredentials 永远不会在 iOS 9+ 上被调用

问题描述:

我正在为 iPhone 开发 VoIP 应用程序.为了接听电话,Apple 开发了 PushKit,以便开发者可以使用 APNS 发送 VoIP 通知.

I am developing a VoIP app for iPhone. To receive calls, Apple developed PushKit so developers can send VoIP notifications using APNS.

在 iOS 8 上一切正常.当我更新到 iOS 9 时,PKRegistryDelegate 在注册后不会触发方法 didUpdatePushCredentials.

Everything was working fine on iOS 8. When I updated to iOS 9, the PKRegistryDelegate does not fire the method didUpdatePushCredentials after registration.

有什么想法/建议吗?

从 Project->Capabilities 启用推送通知"标志解决了我的问题.这很奇怪,因为它早些时候没有它就可以工作.这个回复可能晚了,但希望这对某人有所帮助.我很难弄清楚这一点.

Enabling the "Push notification" flag from Project->Capabilities solved my issue. It's strange because it was working without it earlier. This reply maybe late but hopefully this helps someone. I had a hard time figuring this out.