Android C2DM Registration_ID 最大大小
用于 Android C2DM 服务的 Registration_id 字段的最大可能大小是多少?
What is the maximum possible size of the registration_id field used for Android C2DM service?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
registration_id
的最大大小受 Cookie 的最大大小限制,即 4K(4096 字节)。实际上,代币会比这小得多,但您不应该依赖这种行为。
(
registration_id
不被视为有效负载的一部分,因此 Reno 提到的脚注此处不适用。)来源:我在 Google 的 Android 团队工作。 :)
(我将很快更新文档以使这一点更清楚,因为最近有一些人问。)
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.)
根据此帖子,结果有所不同(给出了 98 和 120) ,但发帖者建议在数据库中保留 255 个,这就是我的想法。
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.
按照此链接底部的脚注。最多应为 1024 字节。另外,如果您使用 Java,则不必担心这一点。[编辑]
就像 Trevor 所说,最大大小应该是 cookie 的大小。 (4096 字节)
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.[edit]
Like Trevor says, the max size ought to be the size of a cookie. (4096 Bytes)