开发者

iPhone APNS Device Tokens in sandbox vs. production

开发者 https://www.devze.com 2022-12-14 10:14 出处:网络
How do device tokens vary from sandbox to production modes? I think I have locked up some device tokens into a production mode, and they can\'t be pushed to from development.

How do device tokens vary from sandbox to production modes?

I think I have locked up some device tokens into a production mode, and they can't be pushed to from development.

Any ideas on 开发者_StackOverflow社区how I can check?


When you build your app using a development cert, the app will generate a unique device token. This device token will not work on the production push network. When you then build your app with a distribution provisioning profile (App Store or Ad-Hoc) your device will generate a different device token for push notifications. If you try to send the development generated token to the production push SSL network, Apple's servers will reject your token.


What I did was to try production first, then if that failed with an InvalidToken code, then try it again against sandbox.

In case you're wondering, yes, this is harder than it needs to be.

0

精彩评论

暂无评论...
验证码 换一张
取 消