Google Cloud Messaging (GCM) is a free service that helps developers send data from servers to their Android applications on Android devices. 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).
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’.
To learn more about GCM and get started, please visit Google Cloud Messaging developers guide.
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 where you use GCM.
- Go to the 'Product Details tab.
- Scroll down to the GCM section of the page.
- Click the 'Edit' button against a GCM sender ID box and paste your GCM API key or C2DM token into the popup and click ‘Link’. This will link the corresponding GCM Sender ID with the app.
- Once done, don't forget to the save the app details by clicking on the Save button at the top of the page.
You can add up to 3 GCM sender IDs. To edit/remove an already linked GCM Sender ID simply click on‘Edit’ and enter a new GCM API key or C2DM token or leave the field empty to remove the previously linked GCM Sender ID. 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 too.