android GCM registration ID max length

AndroidGoogle Cloud-Messaging

Android Problem Overview


In Google Cloud Messaging, what is exactly the registration ID maximum length?

Android Solutions


Solution 1 - Android

A google engineer said the registration ID can be up to 4K. Users have observed it is 255 characters.

Solution 2 - Android

i think i can help you out with this... i´m working with GCM this week, and my device´s registration ID looks like this:

> APA91bHPRgkF3JUikC4ENAHEeMrd41Zxv3hVZjC9KtT8OvPVGJ-hQMRKRrZuJAEcl7B338qju59zJMjw2DELjzEvxwYv7hH5Ynpc1ODQ0aT4U4OFEeco8ohsN5PjL1iC2dNtk2BAokeMCg2ZXKqpc8FXKmhX94kIxQ

163 characters!

i hope this can help you out...

Solution 3 - Android

On iOS all my registration tokens look like this:

lhBV25_Znsk:APA91bHFM9nbX-s0py6-ktzgdpP_y85RahdL3OJ4LG4v-jT_9QY8ZbZH8uK-JNO_BDy75b6RfDT-v-j5W0FXIFTif72ckT3kqLNBDNWYSd5AhxYwdJi3Wqfdqqi-wL8F_k1nm2qUS3Ra

(152 chars)

Note the colon after 11 characters. Note also that it has the sequence "APA..." AFTER the colon, however you should use the whole registration token.

Solution 4 - Android

There's no official limit for GCM ID, the payload size is 4k when I am writing this. Although, it is safe to assume 255 for GCM ID according to this and the discussion before me.

If it is in database that you are asking the question for, I suggest that you use TEXT.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionDahevosView Question on Stackoverflow
Solution 1 - AndroidrdsView Answer on Stackoverflow
Solution 2 - AndroidVaroXView Answer on Stackoverflow
Solution 3 - AndroidLukasz CzerwinskiView Answer on Stackoverflow
Solution 4 - AndroidMayankView Answer on Stackoverflow