push notification - Queue messages in android for sending when device is online -


what best way queue e.g chat messages intended sent server until when device online.

scenario:

1) user sends message (no internet connection or connection timeout)

2) message should sent when there internet connection.

also, if message hasn't been delivered , in process device turned off when device turned up, undelivered messages should sent server.

this thought of:

i: save undelivered messages in device db flag e.g undelivered

ii: keep retrying send messages undelivered flag

iii: listen boot_completed such when device turns up, continue process

...

you can use gcmnetworkmanager handle of required tasks.


Comments