Dahevos
Dahevos

Reputation: 1515

android GCM registration ID max length

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

Upvotes: 51

Views: 39857

Answers (4)

rds
rds

Reputation: 27004

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

Upvotes: 54

Mayank
Mayank

Reputation: 1404

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.

Upvotes: 2

Lukasz Czerwinski
Lukasz Czerwinski

Reputation: 15482

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.

Upvotes: 4

VaroX
VaroX

Reputation: 430

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

Upvotes: 11

Related Questions