iOS 13 not getting VoIP Push Notifications in background

南笙酒味 提交于 2019-12-05 13:34:53

If you build the app with Xcode 11 (and iOS 13 SDK) PushKit won't work any longer if you fail to report to CallKit.

On iOS 13.0 and later, if you fail to report a call to CallKit, the system will terminate your app. Repeatedly failing to report calls may cause the system to stop delivering any more VoIP push notifications to your app. If you want to initiate a VoIP call without using CallKit, register for push notifications using the UserNotifications framework instead of PushKit.

https://developer.apple.com/documentation/pushkit/pkpushregistrydelegate/2875784-pushregistry

pepsy

You can no longer receive a VoIP notification and not report a new incoming call through CallKit, when compiling with iOS 13 SDK.

Check this other question, I've explained the options you can use for notifications that should not alert for new incoming calls.

Answer from @mudassirzulfiqar on Github (Thanks to him). I got voip push notification after uninstall and re-install my app. Now, I will call reportNewIncomingCall in didReceiveIncomingPushWith.

I have figured out the issue, as it is stated in the official forums by Apple that not calling completion will result ban your application after 3 to 5 attempts I guess. So I think when the app get banned in 2 to 3 attempts then it stops receiving voip.

Use case: I reinstalled my application and put my application into the background and didReceiveIncomingPushWith gets called. But because i'm not using completion closure on the right time, probably again Im not going to receive voip next time. And this always work fine when app is in foreground.

The documentation says:

Typically, you keep the push registry object running for the duration of your app.

Try to declare voipPushResgistry as a property of the AppDelegate, instead of a variable of the application(didFinishLaunchingWithOptions) function. Maybe it could help.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!