Troubleshooting post-boot push notification delivery failures

只谈情不闲聊 提交于 2019-12-08 10:37:26

问题


My app receives push notifications successfully if run at least once per boot both in the background and when force closed (thanks to PushKit).

If I reboot the device, I won't receive any pushes until I launch the app at least once.

How can I get this scenario working? I'm running latest Xcode and iOS (8.3)


If I leave the app running in the background when I reboot the device, the app still shows up in the recents menu however no pushes are received and no AppDelegate entry points are hit (that I have anyways).

  • All push/notification permissions are enabled as well as Background App Refresh
  • Background Mode Capabilities are enabled (VoIP, push, fetch)

回答1:


The problem was that the app was going dormant before the callback to update credentials.

The solution was to start a background task in didLaunchWithOptions and end the background task in the didUpdatePushCredentials function.



来源:https://stackoverflow.com/questions/30195091/troubleshooting-post-boot-push-notification-delivery-failures

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