Reputation: 1005
Situation: we have PROD and DEV APN certificates installed on different backend URLs. PRODUCTION certificate works!: pushes are delivered.
DEV certificate does not work, apple servers return error code 7 (invalid token). I have already checked all the stuff but may be I'm still missing something.
Should actually work, right?
Upvotes: 5
Views: 6099
Reputation: 4064
In case of IOS 9, please send notifications from Apple Production Push notification certificate, it will work.
Make pem file from Production APS certificate, and use this file both in development as well as production mode.
Moreover, use gateway of production in both cases which is "gateway.push.apple.com:2195"
Don't use "gateway.sandbox.push.apple.com:2195" even if you are sending notifications in development mode.
Upvotes: 2
Reputation: 7876
The device token returned by the phone for push notifications is different in production and development. Make sure that your server uses an actual development device token (I'm not talking about the certificate but about the device identifier) when making a request to APNS.
If your device already run the production build of your app, the production token may be in your database and your server may try to use it. Depends on how you handled your user accounts though.
Upvotes: 0