Why do Android C2DM push messages not always arrive?

后端 未结 2 996
被撕碎了的回忆
被撕碎了的回忆 2021-01-03 07:05

I\'ve built a functioning C2DM app and generally it works very well, and the push messages arrive fast. However I find that fairly regularly when I first start the app or br

相关标签:
2条回答
  • 2021-01-03 07:11

    This is most likely the correct behaviour. Messages are not guarantied to be delivered at all. Let alone instantly.

    What it most likely is is that the connection between your phone and the Google servers is being dropped and it takes a little while to come back up.

    0 讨论(0)
  • 2021-01-03 07:18

    I realised I made a schoolboy error. I was re-registering with C2DM every time the app started. That process sometimes takes quite a few seconds, and during that time the app will not receive push messages sent to the old registration ID. This explains why push messages were particularly likely to fail to be received immediately after starting the app.

    The solution was to ensure the registration ID is only requested if the app does not already have one. Push messages are now working much more reliably.

    0 讨论(0)
提交回复
热议问题