Reputation: 8357
I am developing push notifications for an app of mine, I wrote the provider in PHP and it works fine. I was previously testing the push notifications with my dev builds and the sandbox server from Apple and everything worked fine, now I am trying to get it to work with an AdHoc build but I never receive any messages on the phone. Here is what I did:
I am really out of ideas what could be wrong, does anybody have an idea? Thanks a lot!
Upvotes: 14
Views: 9395
Reputation: 351
Push certificates for production and development are different. And to make more difficult device tokens for production and sandbox are different for the same device. Cross check if these are correct and Im sure you must have faltered in this. To get device token in Production mode, write an alertview in AppDelegate didreceivenotifications event.
Once you get this token, you will know that it is different from dev token that we are generating which is why you were not able to send notification on PROD
Upvotes: 1
Reputation: 8357
I finally figured this out, the issue is that if you open a connection to the APNS and send over more than one push notification AND one of the tokens you submit is not a token valid for this certificate (eg. you send over a token that belongs to a dev instance whilst being connected with the production certificate) the APNS cancels the delivery of all the PNs that you sent in this batch. At least that is what I experienced so far, so make sure you always keep your dev and production tokens nicely separated :)
Upvotes: 30
Reputation: 626
For distribution and release build always use production certificate.
Upvotes: 0
Reputation: 1
I am struggling with the same issue. I believe the problem is that with adhoc builds, apple will only send notifications to them from the production apns server, try that.
Upvotes: 0