GCM味精交货时间是疯狂古怪味精、古怪、疯狂、时间

2023-09-03 23:12:12 作者:你就是我的理由╮

我已经安装有GCM支持Android应用程序,并有一个小的测试应用程序发送味精的应用程序。 当我在模拟器中运行应用程序,我可以看到(通过日志消息),它与GCM注册并获得一个令牌。

I've setup an Android app with GCM support, and have a little test app to send a msg to the app. When I run the App in the emulator, I can see (via logging msgs) that it registers with GCM and gets a Token.

然后,当我把这个道理在我的测试应用程序,并把它发送味精,结果显示,味精1发送,0失败,0有ID的变化。

Then when I put the token in my test app and have it send a msg, the result shows that 1 msg was sent, 0 failed, and 0 had ID changes.

有时候味精显示了几乎立即,有时需要20分钟。 上周五,我的2测试封邮件用了15和20分钟。 第2我今天早上送者立即,下一个也没有露​​面,但 - 它只是已有10分钟... ...

Sometimes the msg shows up almost immediately, sometimes it takes 20 minutes. On Friday, my 2 test msgs took 15 and 20 minutes. The first 2 I sent this morning were immediately, the next one hasn't shown up yet - it's only been 10 minutes...

有什么我可以做,使该交付时间一直快速前进?随机20分钟延迟将是pretty的多少不能接受的条件。

Is there anything I can do to make the delivery times consistently fast? A random 20 minute delay will be pretty much an unacceptable condition.

推荐答案

我们有同样的问题,但它从网络到网络的变化。我们认为这是家庭集线器路由器(处女超级枢纽)滴活动五分钟后的连接。您可以通过发送一个空的GCM消息每隔两分钟,以保持连接活着确认。

We had the same problem, but it varied from network-to-network. We think it was the home hub router (a Virgin Super Hub) dropping the connection after five minutes of inactivity. You can confirm by sending an empty GCM message every two minutes to keep the connection alive.

下面是一个更深入的解释我们所做的:https://groups.google.com/d/msg/android-gcm/Y33c9ib54jY/YxnCkaPRHRQJ

Here is a more in-depth explanation of what we did: https://groups.google.com/d/msg/android-gcm/Y33c9ib54jY/YxnCkaPRHRQJ