What is the maximum possible size of the registration_id field used for Android C2DM service?
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.)
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.
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)
© 2022 - 2024 — McMap. All rights reserved.