As of April 10, 2018, Google has deprecated GCM. The GCM server and client APIs are deprecated and will be removed as soon as May 29, 2019. Migrate GCM apps to Firebase Cloud Messaging (FCM), which inherits the reliable and scalable GCM infrastructure, plus many new features. See the migration guide to learn more.

Engage your users across Android, iOS and Chrome

Send data from your server to your users' devices, and receive messages from devices on the same connection. The GCM service handles all aspects of queueing of messages and delivery to client applications running on target devices, and it is completely free.

Versatile messaging targets

Distribute messages to your client app in any of three ways — to single devices, to groups of devices, or to devices subscribed to topics.

Downstream messaging

For purposes such as alerting users, chat messaging or kicking off background processing before the user opens the client app, GCM provides a reliable and battery-efficient connection between your server and devices.

Upstream messaging

Send acknowledgments, chats, and other messages from devices back to your server over GCM’s reliable and battery-efficient connection channel.

Send messages from the cloud

Send a message using GCM HTTP connection server protocol:
    "to": "/topics/foo-bar",
    "data": {
      "message": "This is a GCM Topic Message!",

Handle a downstream message on an Android device:

  public void onMessageReceived(String from, Bundle data) {
     String message = data.getString("message");
     Log.d(TAG, "From: " + from);
     Log.d(TAG, "Message: " + message);
     // Handle received message here.

Envoyer des commentaires concernant…