Firebase Cloud Messaging
Firebase Cloud Messaging (FCM) is a cross-platform messaging solution that lets you reliably deliver messages at no cost.
Already using Google Cloud Messaging? Learn more about your options.
|Send notification messages or data messages||Send notification messages that are displayed to your user. Or send data messages and determine completely what happens in your application code. See Message types.|
|Versatile message targeting||Distribute messages to your client app in any of three ways — to single devices, to groups of devices, or to devices subscribed to topics.|
|Send messages from client apps||Send acknowledgments, chats, and other messages from devices back to your server over FCM’s reliable and battery-efficient connection channel.|
How does it work?
An FCM implementation includes an app server that send messages and a client app that receives them. The app server can send messages via the Admin SDKs or the HTTP and XMPP APIs. You can also compose messages without an app server by using the Notifications console.
Firebase Notifications is built on Firebase Cloud Messaging and shares the same FCM SDK for client development. For testing or for sending marketing or engagement messages with powerful built-in targeting and analytics, you can use Notifications. For deployments with more complex messaging requirements, FCM is the right choice.
|Set up the FCM SDK||Set up Firebase and FCM on your app according the setup instructions for your platform.|
|Develop your client app||Add message handling, topic subscription logic, or other optional features to your client app. During the development, you can easily send test messages from the Notifications console.|
|Develop your app server||Decide which server protocol(s) you want to use to interact with FCM, and add logic to authenticate, build send requests, handle response, and so on. Note that if you want to use upstream messaging from your client applications, you must use XMPP.|
Set up your server. If you are writing your server in Node.js, you can utilize the Admin Node.js SDK's FCM API. Alternatively, you can get help with server development using the server setup guide, guides to sending messages with your app server, and the complete references for HTTP and XMPP.
Learn more about sending data payloads, setting message priority, and other messaging options that are available with FCM.