GCM Message is not sent when the app is not open?

后端 未结 2 1763
闹比i
闹比i 2021-01-28 03:44

Recently I implement the GCM on my app. I followed the tutorial code at this website

http://javapapers.com/android/google-cloud-messaging-gcm-for-android-and-push-notifi

2条回答
  •  借酒劲吻你
    2021-01-28 04:47

    The GCM engine will try to deliver a message once it detects you've established a connection to them. I guess that when you kill your app, so is killed the open socket waiting to get messages and they won't try to deliver the message again.

    When you open up the app again, all the pending messages are delivered as the GCM engine will try to deliver all of them once it detects you've established a connection to them, that's why you get them all at the same time.

提交回复
热议问题