是否有效载荷4096字节包括registration_id长度是多少? [英] Does the payload 4096 bytes include the registration_id length?

查看:310
本文介绍了是否有效载荷4096字节包括registration_id长度是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android的GCM文件,它是说,有效载荷可达4096字节的限制。

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

是否有效载荷的4096字节包括registration_id长度是多少?我发现我能发送带有的16038字节(包括registration_ids)的有效载荷。

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).

推荐答案

这不包括注册ID。

我很抱歉不提供任何支持文档。该GCM文件并没有明确说明它。不过,我为了验证这一行为进行了测试。
唯一的证明我能提供的是,在多播消息可以包含多达1000个注册ID。 A 1000注册ID显然不能融入4096字节有效载荷。

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.

从<一个href=\"http://developer.android.com/google/gcm/gcm.html\">http://developer.android.com/google/gcm/gcm.html

registration_ids

registration_ids

一个字符串数组与接收消息的设备(注册ID)的列表。它必须包含至少1个,最多1000注册ID。要发送多播消息,您必须使用JSON。要发送一个消息到一个单一的设备,您可以使用JSON对象只有1注册ID,或纯文本(见下文)。必需。

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.

这篇关于是否有效载荷4096字节包括registration_id长度是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆