Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does GCM locate a user phone

My question is how does the Google Cloud Messaging know where to send the message to? does it work by IP Address? Is there an interval that runs a function on the phone to send the current location or IP Address of the phone to the Google server? Does anyone know?

like image 855
mkieloch352 Avatar asked Oct 16 '12 03:10

mkieloch352


1 Answers

Google doesn't need to know the IP address of your device. Instead, your device connects to Google, identifies itself using whatever protocol Google uses for authentication, and Google then uses that established connection to send notifications to your device.

When your phone changes from one IP address to another, it simply makes a new connection to Google, and Google then uses that new connection for your notifications. Google wouldn't even need to keep track of your IP address after you disconnect, since as soon as you disconnect (like on a public wifi system), somebody else might start using that same address.

like image 131
Greg Hewgill Avatar answered Sep 30 '22 08:09

Greg Hewgill