Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How GCM connection Servers sends messages to an Android device?

I was reading about Google Cloud Messaging(GCM). The push notifications received by GCM Connection Servers are sent to GCM enabled Android device. I assume that internally it uses device Id(and then resolving to IP from MAC using ARP protocol) to send the push notifications. Which protocol GCM uses internally to deliver notifcations? If it is TCP/IP then how it resolves IP of the device(which is not unique given that a user switches wifi networks and mobiles data).

Can anyone help me understand the communication from GCM to the client?

like image 996
Jainendra Avatar asked May 05 '15 18:05

Jainendra


People also ask

How does GCM work in Android?

GCM stands for Google Cloud Messaging. Every push notification receive on any Android device is sent by the GCM only. when sender sends an push notification then it goes to GCM. GCM receives that push and forward it to particular Android Device by its Unique device id.

What is GCM push notification?

Google Cloud Messaging (GCM) was a mobile notification service developed by Google that enables third-party application developers to send notification data or information from developer-run servers to applications that target the Google Android Operating System, as well as applications or extensions developed for the ...

What is difference between GCM and FCM in Android?

FCM is the new version of GCM under the Firebase brand. It inherits GCM's core infrastructure to make sure we continue to deliver messages reliably on Android, iOS and Chrome. Show activity on this post. FCM is the new version of GCM under the Firebase brand.

Is GCM and FCM same?

Firebase Cloud Messaging (FCM), formerly known as Google Cloud Messaging (GCM), is a cross-platform cloud solution for messages and notifications for Android, iOS, and web applications, which as of June 2022 can be used at no cost.


1 Answers

  • GCM works through Google Play Services (no GCM without Google Play Services)
  • Devices connect to Google Play Services through TCP on port 5228 (443 as fallback)
  • Device sends a heartbeat packet to Google Play Services every 28 minutes on mobile and 15 minutes on wifi
  • If device network state changes, the device has to reestablish a TCP connection to Google Play Services, which apparently can lead to problems
  • You can check the connection state, heartbeat interval, connection address and port, etc. dialing *#*#426#*#* on a device

You can find some more information in this post on Google Product Forums.

like image 103
Baris Akar Avatar answered Sep 23 '22 06:09

Baris Akar