Google Cloud Messaging (GCM)
Google Cloud Messaging (GCM) is a free service that helps developers send data from servers to their Android applications. This could be a lightweight message telling the Android application that there is new data to be fetched from the server (for instance, a movie uploaded by a friend), or it could be a message containing up to 4KB of payload data (so apps like instant messaging can consume the message directly).
Getting a Simple API Key
To use GCM, you need to obtain a long-lived token (simple API key). If you are an existing C2DM user, you can use your C2DM token instead. To get a simple API key, follow these steps:
- In the main Google API console, select API Access.
- Click Create New Server Key.
Developers will be able to sign-up for GCM for both Play and non-Play apps. However, GCM stats will be available for only published Google Play apps. To be able to see GCM stats in your Google Play Developer Console, associate the GCM Simple API Key or C2DM token with your Android application. Here’s how:
- Select the application that you would like to add GCM to under All Applications.
- Go to the Services & APIs tab.
- Scroll down to the GCM section of the page.
- Click the Link a Sender ID button.
- Finally, in the dialogue box please enter the Link Sender ID, and then click Link.
Note that you can also revoke your key or a token through Google APIs console. After the key or token is revoked, you can continue to see GCM stats on the Statistics page in your Google Play Developer Console until you remove the GCM sender ID.