Cross-platform messaging solution
FCM is the latest cloud messaging platform from Google which supports Android and iOS devices, and even chrome web apps. This cross-platform messaging solution lets you reliably deliver messages at no cost. Firebase gives you the tools to develop high-quality apps, grow your user base, and earn more money.
Benefits of FCM include:
- Simpler client development: You no longer have to write your own registration or subscriptions retry logic.
- An out-of-the-box notification solution: You can use Firebase Notifications, a server less notifications solution with a web console that lets anyone send notifications to target specific audiences based on Firebase Analytics insights.
Key capabilities
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. |
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. |
FCM Messages
Firebase Cloud Messaging (FCM) offers a broad range of messaging options and capabilities. The information in this page is intended to help you understand notification messages and data messages and what you can do with them using FCM’s options.
Message types
With FCM, you can send two types of messages to clients:
- Notification messages, sometimes thought of as “display messages.”
- Data messages, which are handled by the client app.
A notification message is the more lightweight option, with a 2KB limit and a predefined set of user-visible keys. Data messages let developers send up to 4KB of custom key-value pairs. Notification messages can contain an optional data payload that is delivered when users tap on the notification.
Notification message
FCM automatically displays the message to end-user devices on behalf of the client app. Notification messages have a predefined set of user-visible keys and an optional data payload of custom key-value pairs.
{ “to” : “bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1…”, “notification” : { “body” : “great match!”, “title” : “Portugal vs. Denmark”, “icon” : “myicon” } }
Data message Client app is responsible for processing data messages. Data messages have only custom key-value pairs.
{ “to” : “bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1…”, “data” : { “Nick” : “Mario”, “body” : “great match!”, “Room” : “PortugalVSDenmark” }, }