Scoota P
Scoota P

Reputation: 2551

APNS or GCM Device Token Validation

Does APNS or GCM device tokens have any special characters in them? we are trying to do server side validation of the tokens and need to know if we should just check for a-z0-9 and eliminate everything else?

Upvotes: 4

Views: 5680

Answers (1)

Eran
Eran

Reputation: 393811

APNS device tokens are 32 bytes in binary format. If you choose to represent them as 64 hexadecimal characters, then they would contain just the hexadecimal characters (0 to 9 and A to F).

As for GCM Registration IDs, even though Google don't give any rules regarding possible characters, from what I observed, they use only 64 characters - A to Z, a to Z, 0 to 9, '-' and '_'.

Upvotes: 4

Related Questions