Android C2DM Registration_ID max size
Asked Answered
Z

3

11

What is the maximum possible size of the registration_id field used for Android C2DM service?

Zedekiah answered 6/10, 2010 at 0:17 Comment(1)
unfortunately there is no answer to this question..Kenweigh
C
9

The max size for a registration_id is bounded by the max size for a cookie, which is 4K (4096 bytes).

In practice, the tokens are going to be much smaller than that, but you shouldn't rely on this behavior going forward.

(The registration_id is not considered part of the payload, so the footnote Reno mentioned doesn't apply here.)

Source: I'm on the Android team at Google. :)
(I'll be updating the docs soon to make this more clear, since there's been a few people asking recently.)

Classy answered 19/10, 2011 at 1:3 Comment(1)
Hello, If you have time please check my question here about the registrationId pattern: #12404128Amnesia
D
2

According to This thread results vary (98 and 120 are given), but the poster recommends setting aside 255 in your database, and that's what I'm going with.

Damalas answered 8/3, 2011 at 16:17 Comment(0)
R
0

As per the footnote at the bottom of this link. it should be 1024 bytes at the most. Also this shouldn't be of concern if you are using Java.

private void handleRegistration(Context context, Intent intent)
{
        String registration = intent.getStringExtra("registration_id"); 
      .... }

[edit]

Like Trevor says, the max size ought to be the size of a cookie. (4096 Bytes)

Rijeka answered 1/2, 2011 at 5:21 Comment(2)
I think, the message size limit(at the link) is for the push message. It is just a presumption, that the registration id has the same limits.Favoritism
Well you are right, Trevor who works for Google, has the right answer.Rijeka

© 2022 - 2024 — McMap. All rights reserved.