Understanding Google Cloud Messaging (GCM) process flow for mobile notifications

Today we will learn how Google Cloud Message (GCM) works. To understand complete process flow see below image

This image explains the complete process flow of how GCM works for sending notification to mobile devices. There are total 6 steps, where steps 1 to 4 are performed only once in initial and step 5 and 6 are performed for sending message each time.

  1. Register app with GCM – This step is performed on mobile device. In this step app sends a request to GCM server with needed app and device information.
  2. Receive registration id from GCM – In response to the request sent in first step GCM sends a registration id which can be used further for sending messages from server to mobile
  3. Send registration id to app server – After getting registration id from GCM, app sends this registration id to the app server from where all app notification will be sent
  4. Save Registration id – App server can store this registration id anywhere like database or file system etc.
  5. Send message to GCM with registration ids – When ever app server need to send notification to the mobile device, it send a request to GCM server with message details and registration ids where this message need to be delivered.
  6. GCM delivers message to devices related to registration ids – When GCM receives the request it sends notification to mobile device related to registration id and mobile app can catch that message and show a notification.
In next few articles we will learn how to write android and C# code to perform all above steps.
Here is the list of example of all operations explained above:

Leave a Reply