android – error = TooManyMessages GCM

我开始实施GCM.

我正在使用official tutorial by Google.

我在Google上发现没有关于此错误的信息.有人知道这是什么意思吗?

我是从BroadcastReceiver得到的:

if (GoogleCloudMessaging.MESSAGE_TYPE_SEND_ERROR.equals(messageType)) {
        sendNotification("Send error: " + intent.getExtras().toString());
        Log.i(TAG, "Send error: " + intent.getExtras().toString());


07-11 16:56:55.083: I/GCMDemo(3425): Send error: Bundle[{error=TooManyMessages, message_type=send_error, google.message_id=1}]

最佳答案 这意味着您在设备脱机时向同一设备发送了100多条没有折叠密钥的消息.达到该限制后,GCM服务器将丢弃存储的消息,并在重新联机时将TooManyMessages错误发送给设备.

Note: There is a limit on how many messages can be stored without collapsing. That limit is currently 100. If the limit is reached, all stored messages are discarded. Then when the device is back online, it receives a special message indicating that the limit was reached. The application can then handle the situation properly, typically by requesting a full sync.

点赞