7

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?

Jainendra
  • 24,713
  • 30
  • 122
  • 169

1 Answers1

18
  • 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.

Community
  • 1
  • 1
Baris Akar
  • 4,895
  • 1
  • 26
  • 54
  • https://firebase.google.com/docs/cloud-messaging/concept-options#ports_and_your_firewall suggests that ports 5228-5230 are now used. – James Wald Dec 05 '18 at 23:14