Thursday, July 12, 2012

Google Cloud Messaging (GCM)

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).

GCM replaces beta version of C2DM (Android Cloud to Device Messaging). Please note that C2DM is now deprecated, and that we are no longer allowing new manual C2DM sign-ups. Developers who do not switch to GCM, can continue to use C2DM with no quota increase.

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:
  1. In the main Google API console, select ‘API Access’.
  2. Click ‘Create new Server key’.
To learn more about GCM and get started, please visit Google Cloud Messaging developers guide.

GCM statistics

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:
  1. Select the application where you use GCM.
  2. Go to the 'Product Details tab.
  3. Scroll down to the GCM section of the page.
  4. 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.
  5. 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.

No comments:

Post a Comment