Our app is now using the production certificate for iOS push notifications.
We have been through several rounds where pushes work, and then they just stop working. Often the "stop working" is associated with some server failure. However the server we are using says that we are still suing the same p12s generated when I made the certs but they are getting an error code 8 from Apple which means it's an invalide token.
I regenerate the certs and "dirty" the profiles/identifiers reload the p12s on the server and everything works fine ... for a while. Then they just magically start getting "error Code 8"s and we have to start all over again.
Today I noticed that a previous build of our app works fine still but the current build does not. They were both built with the same provisioning profiles and/or enterprise distribution profiles, both were using the same certs for the app ID, both loaded up to TestFlight (just for informational purposes) and have identical push related code in them.
The strange thing is that when I use the older build I get back a 4xxxxx... device token (consistently the same one) and when I use the new build I consistently get back a 5xxxxx... device token from Apple (consistently the same one).
I know for a fact that the previous build was getting the 5xxxx... device token previously because I check that on a fairly consistent basis.
However, I have noticed that some of our testers are registered for more device tokens than they say they have devices so this issue could have been going on for a long time and I mistakenly thought that it was another issue.
What causes the device token to have a consistent but different numbers?
What is the anatomy of a device token?
Does anyone have any idea why the exact same profiles/identifiers would suddenly stop working for the exact same push cert?
Thanks