GCM Push messages are stored on the server until a new one appears.

I am developing an application using Google Cloud Messaging with the latest version of Google Play Services.

If I disconnect the device’s network connections, all messages that should have been received during the time when I do not have Internet access are stored on the server, and I do not receive them until a new one arrives, when I turned one of my network connections are back on.

So, if I receive 20 new messages at night, when I have WiFi / 3G turned off, when I switch my WiFi in the morning, I do not receive any messages, and when the first new message arrives, I get 21 notification clicks immediately.

The question is, is there ... around? Is this the problem of my implementation, or is this the expected behavior, and I need to find some workaround?

Thanks!

Minor editing: I do not receive 21 notifications immediately, because the push messages I send are discarded, but I do not receive a minimized message until a new one arrives.

+4
source share
1 answer

This is similar to the time_to_live parameter time_to_live on the message payload. Quoting Android Docs on the same:

time_to_live . How long (in seconds) the message should be stored in the GCM repository if the device is offline (the default lifetime is 4 weeks).

Good luck

+3
source

Source: https://habr.com/ru/post/1497552/


All Articles