Reputation: 719
One of our clients has reported that they are receiving APNS device tokens longer than 32 bytes. Apple states in their official documentation that device tokens are 32 bytes, and this causes several issues with the App (we provide them a SDK) and our backend. Does anybody know under which circumstances are these longer tokens generated?
Even in Amazon SNS, if I try to create an end-point with this token, I receive the following error.
Invalid parameter: Token Reason: iOS device tokens must be 64 hexadecimal characters (Service: AmazonSNS; Status Code: 400; Error Code: InvalidParameter; Request ID: f6c26498-68b4-55ac-82a0-2a5fbc9ffcab)
So it is clear that tokens could not be longer than 32 bytes.
I refuse to update the code because I have not even able to understand what is going on because the lack of information.
PS: What an irony - this appeared when adding tags to this question.
Edit: Adding proof
Upvotes: 1
Views: 1844
Reputation: 719
EDIT: It was caused by a library that sends mock notifications / tokens to the iOS simulator.
Original Answer: Hate to answer my own question, but finally managed to solve it.
I have decoded the token, and it is not actually a token... It is a string encoded as NSData containing : simulator-remote-notification=10.1.7.184:9930
(don't have access to client code, so I don't know how this happened.).
Hope someday, someone will find this information useful.
Upvotes: 4