接收Android GCM消息这么慢? [英] Receive Android GCM messages so slow?
问题描述
谷歌云消息传递(推送邮件)的问题。
我有两个智能手机(HTC感觉XE,Desire HD的)和平板电脑(三星Galaxy Note 10.1 WiFi版)。
有时候,我需要等待近15分钟收到GCM推送消息。有时候,我立即收到GCM推送消息(内30秒)。
这是正常的?或者仅仅因为我是在无线连接?
如果是正常的,是否还有其他服务,如长轮询我可以使用从服务器端获取消息?
我目前使用GCM +轮询(AlarmManager)来检索来自远程服务器的消息。
任何建议或更好的想法?
Google Cloud Messaging (Push message) problem.
I have two smartphones(HTC Sensation XE, Desire HD) and a tablet(Samsung Galaxy Note 10.1 Wifi).
Sometimes I need to wait for almost 15 minutes to receive the GCM push messages. Sometimes I receive the GCM push messages immediately(within 30 secs).
Is it normal? Or just because I'm under Wifi connected?
If it is normal, are there any other services like "long-polling" I can use for retrieving messages from server?
I'm currently using GCM+Polling(AlarmManager) to retrieve messages from remote server.
Any suggestions or better ideas?
下面是我的测试结果:
左侧是服务器发送时间,而右侧则是客户端的移动接收时间。
所有的测试结果是无线连接的环境下。
==========================
HD
23时10分十八秒,23:24:XX
Below is my test result:
The left side is server send time, while the right side is client mobile receive time.
All the test results are under Wifi connected environment.
==========================
HD
23:10:18, 23:24:XX
XE
23点11分21秒,二十三时22分44秒
XE 23:11:21, 23:22:44
请注意
23点10分二十秒,23时14分54秒
Note 23:10:20, 23:14:54
HD
0点08分12秒,0点08分27秒
==========================
HD
00:08:12, 00:08:27
XE
○点07分55秒,0时07分58秒
XE 00:07:55, 00:07:58
请注意
0时08分04秒,○时13分35秒
Note 00:08:04, 00:13:35
HD
0时四十分21秒,0点55分22秒
==========================
HD
00:40:21, 00:55:22
XE
0时39分56秒,0时40分十四秒
XE 00:39:56, 00:40:14
请注意
〇点四十分13秒,〇点40分59秒
Note 00:40:13, 00:40:59
谢谢!
推荐答案
GCM使用节流时,有过度使用,详情请参阅下列文件:
GCM uses throttling when there's excessive use, see the following document for more details:
http://developer.android.com/google/gcm/adv。 HTML#节流
这篇关于接收Android GCM消息这么慢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!