简体   繁体   中英

iOS: How to identify device token string if it's development or production?

I have problem on Apple push notification in my backend. All my device tokens were stored in my database either development and production. During I push message to APNs, I got invalid device token message and the connection is closed. The push notification operation is never completed. Would you mind giving me the solution to identify if it's development or production device token?

The root of your problem sounds like you're sometimes using the wrong certificate for the token - dev cert with production token etc.

Announced by Apple today that you now only need one certificate for both environments. This would mean that you're always using the correct certificate for your tokens, and might therefore fix your problem.

Obviously, as has already been stated, you need to keep your dev/production environments separate (or at least mark records as coming from one particular environment).

Hope this helps.

The device token generated is decided by operating system and hence its random. We cant identify the device token environment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM