I’d like to keep data in sync between server and clients.
I’ve tested Messaging + Push Api exhaustingly.
What I found is:
Messaging works only, when the app is not killed.
Push (GCM) oftn laggs minutes whereas Messaging is extremely fast.
Based on this knowledge my first approach was:
Use Messaging, when application is aktive and combine with GCM as backup, when app is closed.
Turns out that spontanious registration / unregistration to channels via GCM doesn’t work.
Outcome: Messages get delivered via both GCM and Messaging Api.
Next possible approach could be:
Run Messaging in a background Service, not attached directly to the app. Save data locally, observe the data from the app. No use of GCM at all.
Question here: How about battery/connection consumption?
I did not test this approach yet. Would be great to get some information on the Messaing Api internals.
Any other best practices to achieve fast synchronization?