Firebase Cloud Messaging (FCM) is the new version of GCM. It inherits the reliable and scalable GCM infrastructure, plus new features! See the FAQ to learn more. If you are integrating messaging in a new app, start with FCM. GCM users are strongly recommended to upgrade to FCM, in order to benefit from new FCM features today and in the future.

Code Samples

Google provides several samples to help you with GCM development.

Messaging app example

For an example of GCM running in the context of a simple messaging application that combines GCM with Analytics, Sign In and AdMob APIs, see Friendly Ping. This sample includes example app server implementations in Java and Go.

Server "playground" example

The GCM Playground provides a reference implementation of a GCM app server in the form of a playground that developers can use to test the Google Cloud Messaging Service.

GcmNetworkManager sample

For an example of how to use the GcmNetworkManager API to schedule reliable network tasks in your application, see the GcmNetworkManager quickstart sample.

Android demo app

The GCM Android demo app on GitHub demonstrates a range of Google Cloud Messaging features, including topic messaging, upstream messaging, and scheduling tasks with the Network Manager.

Send feedback about...

Cloud Messaging
Cloud Messaging