Registration ID size

21,102 views
Skip to first unread message

Tomer Peled

unread,
Jul 24, 2012, 2:59:33 AM7/24/12
to andro...@googlegroups.com
Hi,

I've searched the documentation and the web for an answer for the question : "What is the size of the registration id?" but with no success.
I've found places which says it should be considered as the size of a cookie which is 4096 bytes, but some other places just use 163 bytes.
Notice that from tests which I've made it indeed use 163 bytes on regular base.
How should I store this key in my db? what size should I limit it?

Thanks,
Tomer

Francesco

unread,
Jul 24, 2012, 3:26:35 AM7/24/12
to andro...@googlegroups.com

The regID could grow up to 4k,
  f

--
You received this message because you are subscribed to the Google Groups "android-gcm" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-gcm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/android-gcm/-/rtSPjqRG0MQJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Tomer Peled

unread,
Jul 25, 2012, 5:49:20 AM7/25/12
to andro...@googlegroups.com
OK Thanks

בתאריך יום שלישי, 24 ביולי 2012 10:26:35 UTC+3, מאת Francesco Nerieri:

The regID could grow up to 4k,
  f

On Jul 23, 2012 11:59 PM, "Tomer Peled" <tomer...@gmail.com> wrote:
Hi,

I've searched the documentation and the web for an answer for the question : "What is the size of the registration id?" but with no success.
I've found places which says it should be considered as the size of a cookie which is 4096 bytes, but some other places just use 163 bytes.
Notice that from tests which I've made it indeed use 163 bytes on regular base.
How should I store this key in my db? what size should I limit it?

Thanks,
Tomer

--
You received this message because you are subscribed to the Google Groups "android-gcm" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-gcm+unsubscribe@googlegroups.com.

Yim

unread,
Aug 4, 2012, 2:51:09 PM8/4/12
to andro...@googlegroups.com
Haven't see registration_id longer than 163 chars. Has anyone here seen registration_id larger than that? Possibly, 256 bytes is a safe value for storage. 

4K simply does not make sense. 

alpaca

unread,
Aug 7, 2012, 2:35:02 PM8/7/12
to andro...@googlegroups.com
I just had the same question (how large can a registration_id get so know how much storage to allocate to it).

4k does seem like a lot, but I assume GCM is encoding some type of data (at least I hope so).

Bastiaan Naber

unread,
Feb 14, 2013, 2:18:17 PM2/14/13
to andro...@googlegroups.com
Mine currently is 184 chars long. I read there have been once longer than 200.

Op zaterdag 4 augustus 2012 20:51:09 UTC+2 schreef Yim het volgende:

Claiton Lovato

unread,
Nov 6, 2013, 10:18:22 AM11/6/13
to andro...@googlegroups.com
Hi Francesco, can you please point me to the documentation on this please?
 
I cant understand how the regid could be up to 4kb as the payload itself is restricted to 4kb?
 
Regards,
Claiton

Eran Eyal

unread,
Nov 8, 2013, 10:56:07 AM11/8/13
to andro...@googlegroups.com
The Registration ID is not counted in the size limit of the payload, so its max size has no relation to the 4k payload restriction.

vinil chandran

unread,
Jul 21, 2014, 2:29:57 AM7/21/14
to andro...@googlegroups.com
I am using VARCHAR as the filed type for GCM Device ID on MySql database table. Is it a good datatype for GCM Device ID or anything else where? If VARCHARE is the better one what will be the Length/Values   i need to specify?

Francois Groulx

unread,
Jul 21, 2014, 4:09:26 AM7/21/14
to andro...@googlegroups.com

255 is perferct with varchar. 4k is for the payload, not the reg id.

To unsubscribe from this group and stop receiving emails from it, send an email to android-gcm...@googlegroups.com.

To post to this group, send email to andro...@googlegroups.com.

vinil chandran

unread,
Jul 22, 2014, 1:06:42 AM7/22/14
to andro...@googlegroups.com
Is payload the size of the message we send through GCM? Then if i have a message with X words and i want to broadcast it to Y devices. Then what will be the payload?
is it X or XY ? and also i would like to know what will be the maximum number of devices we can broadcast a message(ie, maximum value of Y)

Francois Groulx

unread,
Jul 22, 2014, 9:30:13 AM7/22/14
to andro...@googlegroups.com

Payload is only X and Y is max 1000 by connexion with Google server. When you make a connexion you send each payload with a single reg id individualy with while for or foreach with max1000. If you have more device/client.  Just redo the operation with the next batch of 1000.

Costin Manolache

unread,
Jul 22, 2014, 2:16:48 PM7/22/14
to andro...@googlegroups.com
Payload is the sum of lengths of key/value pairs in the message, I assume that's X in your question.

1000 is max regids per HTTP message. 

If you use XMPP - multiple registrations IDs are not supported, but you can just stream the individual messages, there is no big benefit of using 
multiple recipients on the XMPP connection.

Costin 


Rishabh Gupta

unread,
Aug 20, 2015, 3:27:37 PM8/20/15
to android-gcm
Hi!
is this really 4K size even today or more or less? Please specify the size of key...

Francois Groulx

unread,
Aug 20, 2015, 3:34:21 PM8/20/15
to andro...@googlegroups.com

4k is the limit fir the hole payload, if the regid grow 4k, the message would be 0k. 255 varchar is enough for mysql database to store the reg id.

To unsubscribe from this group and stop receiving emails from it, send an email to android-gcm...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages