android GCM registration ID max length

主宰稳场 提交于 2019-11-27 07:56:56

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

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...

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!