i need to know and understand what is the concept used by google cloud messaging to push notification to the device. I know that GCM check every some minute if there are new messages awaiting, if yes google push this message to android app, my question is how google push this message to the specific android app ?
2 Answers
1
votes
It's explained in the Google documentation
https://developer.android.com/google/gcm/gcm.html#s2s
This is how these components interact:
- Google-provided GCM Connection Servers take messages from a 3rd-party app server and send these messages to a GCM-enabled client app (the "client app"). Currently Google provides connection servers for HTTP and XMPP.
- The 3rd-Party App Server is a component that you implement to work with your chosen GCM connection server(s). App servers send messages to a GCM connection server; the connection server enqueues and stores the message, and then sends it to the client app. For more information, see Implementing GCM Server.
- The Client App is a GCM-enabled client app. To receive GCM messages, this app must register with GCM and get a registration ID. If you are using the XMPP (CCS) connection server, the client app can send "upstream" messages back to the 3rd-party app server. For more information on how to implement the client app, see the documentation for your platform.
-1
votes
At the time of registration of app with gcm an id saved on gcm server and returned to app as well that gcmRegistrationId saved on app server and when anyone want to send push notification to a specific id then message sends to gcm server with that gcmRegistrationId and by comparing that id gcm sends that message to a particular client.