Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GCM - Max length for Registration ID

Update: GCM is deprecated, use FCM

What is the maximum length for a Registration ID issued by GCM servers? GCM documentation do not provide this info. Googling for this reveals that Registration ID is not fixed length in nature and can be up to 4K (4096 bytes) in length. But these are not official answers from Google. I am currently receiving Registration IDs which are 162 characters long. Can anybody help?

like image 689
Raj Chaudhari Avatar asked Jul 26 '12 11:07

Raj Chaudhari


People also ask

What is GCM registration ID?

A Registration ID is an identifier assigned by GCM to a single instance of a single application installed on an Android device. The device is assigned this identifier when it registers to Google Cloud Messaging. The GCM documentation doesn't specify what information is encoded in this identifier.

What is the length of Firebase token?

Usually, cookies are limited to 4096 bytes, which consist of name, value, expiry date etc.


2 Answers

On android-gcm forum a google's developer confirms it's 4k

like image 164
macno Avatar answered Oct 13 '22 18:10

macno


I am interested in know about this also. My reg id size is 183 chars. I suspect it won't be longer than 512 chars though, let alone 4K. Imagine sending bulk notification, a 4K reg id x 1000 = 4MB message size!

In the end, I just use the 'text' type in my MySQL table to store the registration id. So even if google send me a 1K, 2K, or 4K (very unlikely) reg id, I will be able to handle it.

Update: I have come across a new reg id size: 205.

like image 24
azgolfer Avatar answered Oct 13 '22 19:10

azgolfer