Reputation: 11
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?
Upvotes: 1
Views: 1527
Reputation: 5017
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.
Upvotes: 1
Reputation: 882
The device token generated is decided by operating system and hence its random. We cant identify the device token environment.
Upvotes: 0