Does it work by polling the servers periodically ? Does it work using long-held http request , like comet ? Or theres some new technology they are using ?
1 Answers
Here is a good overview: http://developer.android.com/google/gcm/gcm.html
Somewhere it explains that GCM is preferred to the app polling because the Android OS is doing the polling through a long-held OS connection to the GCM server. So even though they call it "push" technology it is really being polled/pulled by the device. The OS then tells the app there is a message and the app retrieves it. Google is just doing the work for all apps through one channel that the OS already uses to check for updates so the device won't be constantly polling as all apps check back to their servers if GCM wasn't used.
There are IDs that help the OS know which app needs which message and the developer needs to set up and maintain a server that helps "push" the messages to device(s). There can be broadcast type messages or messages targeting individual devices. Google outlines a couple of different types of communication mechanisms - HTTP and XMPP.
No real new technology - Google is just providing a platform/interface/architecture for developers.
This info just touches the surface - there is much more detail in the documentation.

- 1,294
- 1
- 20
- 20
-
Google and Apple seem to have removed any references to the workings of their push technology. Even the google GCM link which you have shared has been updated and doesn't talk about how push technology is just a pull/poll. It seems obvious because a device can have a static IP at any given time and it would cause security issues for a server to be able to directly touch a device. Are there are other references that you are aware of that explain what you've written here? – Saifur Rahman Mohsin Sep 15 '18 at 11:07
-
Hmmm. It looks like Google deprecated their GCM feature on April 2018. They are now referring developers to their Firebase Cloud messaging: https://firebase.google.com/docs/cloud-messaging/. I don't know much about that. My information in the answer was based on some investigative work I did but ended up not implementing. – Gravitoid Sep 17 '18 at 14:46