I have released my app update with push notifications however when I check my server, I notice that the token that was sent to the database is “null”. I did lots of testing using a development certificate AND a production certificates for ad hoc. Both worked succesfully but the version on the app store does not and I have no idea why. I posted about this issue about 2 weeks ago and someone told me I should not use the provisioning profile I used for ad hoc so I created a new provisioning profile with the same id. Update got releases yesterday and I still have the same problem. I need to find a permanent solution since my users are getting annoyed with all these updates but I don’t know how to test until it gets approved on the app store.
If anyone can please offer thoughts or assistance I would really appreciate it. Thanks in advance.
P.S. if it helps, I deleted my app from my device and installed it again from the app store… It did not ask me if I wanted to receive push notifications but push is enabled for the app from the phone settings…
There are 3 steps in an APNs communication:
In your case, I understand that your problem is in step 1 because you said that you are having a null device id and the app is not asking you about the APNs permission. Therefore, changing your server certificate or switching from gateway.sandbox.push.apple.com to gateway.push.apple.com is not going to help because the error happens before.
This is clearly a problem with your certificates. You should check that you have done all the required steps in your Apple iOS Provisioning Portal:
If your want to be sure that your binary was generated with the correct profile before submitting it again to AppStore, do the following:
I bet that if you check your previously archived apps you will see an incorrect profile. This is the only cause for your app not to return a deviceToken. (unless it receives it but it is not correctly sent to your server, a problem in step 2 of the communication above).