iPhone SDK Push Notification

谁都会走 提交于 2019-12-03 08:56:56

I was having this problem as well. The symptom was the app would crash when calling [[UIApplication sharedApplication] registerForRemoteNotificationTypes:...].

It seems that once a given device loads an APNs Distribution Profile, trying to later go back to using an APNs Development Profile will not work unless you change the App ID.

If you create a user-defined build setting in Xcode, as suggested here:

iPhone "Good Practices"

you can stop the crashing and also have both versions co-exist on the same device for testing, etc.

I solved this problem on one of my development devices by installing a random application from the App Store which uses push notifications. In this case, I installed the Le Monde.fr application. After I ran that application once, my own application no longer crashed.

I managed to get this working by re-requesting all of the certificates etc..

I solved this by going to Settings, then toggling the top "master" Push Notifications switch off, then back on.

Lengthy but sure shot solution is to "Erase all Content and Settings".

Here's my solution, and it has to do with how adhoc profiles work. Adhoc profiles cannot be installed via xCode. You need to build and archive the app, and install using iTunes or the organizer. That fixed it for me.

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