GCM will be familiar to developers who have used Google Cloud Messaging for Android. To send a message, all you need to do is:
- Request a token (channel ID) via chrome.pushMessaging.getChannelId().
- Pass the returned token to your server.
- Whenever you need to send a message to your app or extension, post the message along with the token to the GCM server-side API.
To use GCM, your users must be signed into Chrome, as the service relies on an efficient push channel that’s only established for signed-in users. Messages are automatically delivered to all the devices where the user has signed in and installed your app/extension.
To add GCM to your app/extension, take a look at the overview of the service or start with some of the sample apps—and start pushing!