I understand there is a difference between a device token in distribution build vs a development build.
I have push notifications working for sandbox mode with my device token.
I created new certificates for distribution and I get successful delivery to the APSN in the distribution environment.
However, my device no longer gets the notifications (which I suspect occurs because I have my development device token being sent the the server) when using distribution settings.
I have gone to Project Scheme and set the Build Configuration to Release but the device token I get is still the same as it was before.
(Also note that I have set the Application Bundle ID to allow push notifications in both development and distribution, and I am using the distribution certificate on the server).
Could you please advise me on what I am missing to get push notifications working in development mode and what I am doing wrong to get the 'live' device token I need to send push notifications?
Bonus Question: Why does the server not return an error of "invalid device token" if it's getting a development device token instead of a distribution token for the live APNS?
ANSWER:
Needed to archive the project and export as ad-hox distribution. That worked.
In order to test your app for push notifications you will have to wait for it to be approved.If that's not an option you can still distribute the Distribution version of your app using ad hoc.
When your application ready for submission, you create an ad hoc provisioning profile specifying an App ID that matches one or more of your apps, a set of test devices, and a single distribution certificate.
Here is an image to illustrate how the provision profile works:
source
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With