How GCM Finds a Custom Phone

My question is, how does Google Cloud Messaging know where to send the message? Does it work by IP address? Is there an interval that functions on the phone to send the current location or IP address of the phone to a Google server? Somebody knows?

+6
source share
4 answers

Google does not need to know the IP address of your device. Instead, your device connects to Google, identifies itself using any protocol that Google uses for authentication, and Google uses this established connection to send notifications to your device.

When your phone changes from one IP address to another, it simply establishes a new connection with Google, and Google then uses this new connection for your notifications. Google doesn’t even have to keep track of your IP address after disconnecting, because as soon as you disconnect (for example, in a public Wi-Fi system), someone else can start using the same address.

+5
source

Here is a link that explains how GCM works http://developer.android.com/guide/google/gcm/gcm.html

+2
source

Each GCM client creates a unique device token that must be sent to the GCM server to send push notifications to the client.

Here you can find a link explaining GCM.

0
source

GCM works by running its own service for processing push notifications.

This service requests a Google Cloud Server (GCM) with your application's token identifier created by GCM for any pending notifications created by your application, and sends a response with all notifications from your token identifier to your application, and this happens for all applications that use GCM.

So basically, if you have 5 applications that have implemented GCM, then their token identifiers will be sent together by this service, and GCM will check if any notification is available for the sent token identifier and sent as a response. Read this topic, this guy explained it, and GCM is reliable for new builds of applications.

http://eladnava.com/google-cloud-messaging-extremely-unreliable/

0
source

Source: https://habr.com/ru/post/927804/


All Articles