2
votes

I have push notifications working perfectly for my app using the development aps-environment. However they do not work for the production environment. As far as I an aware, all my certificates and private keys are correct. I am trying to test the production aps-environment on an ad-hoc distribution provisioning profile, not my App Store profile.

I'm wondering us it even possible to test production push notifications with an ad-hoc profile? Is there anything else I should be checking for?

3

3 Answers

4
votes

I just had the exact same issue. Drove me crazy for a day. Did you change the APNS server URL in your PHP script to 'ssl://gateway.push.apple.com:2195' ? This is different from the what is used during development.

Also make sure you have all the production certs in place, etc...

1
votes

Yes, it is possible to use production push notifications with an Ad-Hoc profile; Ad-Hoc is considered to be production just like the App Store profile. Make sure you are:

  • actually building your app with the production profile (not development),
  • using the production push cert on your server (not development), and
  • hitting the production apple push gateway server (not the sandbox).

Apple keeps the development environment completely separate from the production, so if those three things do not line up, it will not work. You cannot mix and match them.

0
votes

If you are sure your certificates et al are correct, also check that you're trying to send to your payload to the Production push token of your device. Each device has two distinct push tokens - one for development and one for production. You cannot send a push notification to a development push token via a production certificate.