iOS application missing from notification center [closed]

梦想的初衷 提交于 2019-12-03 05:36:23
just.jimmy

This was happening to some of my devices. (Not showing up in notification center and not receiving pushes.)

Managed to fix it by doing:

  • Delete the app
  • Delete all the relevant profiles from the device. Settings app > General > Profiles, then tap into each of the Provisioning Profiles related to your app, then tap Remove. On iOS 8/9, where the setting no longer exists, use XCode > Windows > Devices > select device > Show provisioning profiles... > then remove the profile(s)
  • Turn your phone off, then on again.
  • Give 5 mins
  • Reinstall your app, the Provisioning Profile should get installed automatically.
  • Launch app and let it register and stuff.
  • Test push notifications again

For us, it didn't work immediately, so give it a few minutes.

Maybe there is a problem with registering and unregistering the app at login/logout respectively, from Apple's documentation:

An application should register every time it launches and give its provider the current token.

And not sure about unregistering, they don't mention unregistering in their programming guide, maybe the app should never unregister and the server should handle that, by sending or not sending push notifications depending if the user is logged in or not. This is how I've done it in the past, and never experienced this issue, so maybe this approach works for you too.

Jennifer

Well, I also have this problem, I found that as the application used the unregisterForRemoteNotifications before uninstall at the previous install.

And, in addition, if the application install again and login to register for the remote notifications, this problem will happen.

It happened also at the first install(installed after reset your iOS device). if you use the unregisterForRemoteNotifications before login, then register at the login operation, this problem will happen.

As this problem happened, you need to restart the iOS device.

For the unregisterForRemoteNotifications, we couldn't stop this problem, but we can reduce the probability of the occurrence of the problem, the method is:

If the device token didn't delete from provider at the previous install, then use unregisterForRemoteNotifications at the current install before login; Otherwise, you should never use unregisterForRemoteNotifications.

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