Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the payload 4096 bytes include the registration_id length?

In the Android GCM document, it is said that the payload is up to 4096 bytes limit.

Does the payload's 4096 bytes include the registration_id length? I found I could send a message with a payload of 16038 bytes (including the registration_ids).

like image 949
user1556497 Avatar asked Dec 04 '12 09:12

user1556497


1 Answers

It doesn't include the registration ids.

I'm sorry for not supplying any supporting documentation. The GCM documentation doesn't state it clearly. However, I tested it in order to verify this behavior. The only "proof" I can supply is that in a multicast message you can include up to 1000 registration ids. A 1000 registration ids obviously cannot fit into the 4096 bytes of the payload.

From http://developer.android.com/google/gcm/gcm.html :

registration_ids

A string array with the list of devices (registration IDs) receiving the message. It must contain at least 1 and at most 1000 registration IDs. To send a multicast message, you must use JSON. For sending a single message to a single device, you could use a JSON object with just 1 registration id, or plain text (see below). Required.

like image 150
Eran Avatar answered Sep 27 '22 16:09

Eran