Firebase Cloud Messaging

Firebase Cloud Messaging (FCM) is a cross-platform messaging solution that lets you reliably deliver messages at no cost.

By using FCM, a new email or new downloadable data can reach your client apps in a click of a button. It is mainly used for notification messages, for users to reengage on your app. A message can be transfered for up to 4KB.

Key capabilities

  • Sending of notification messages or data messages, can be displayed to your client users or
    can depend entirely on your application code.
  • Versatile message targeting, client apps can receive in any of the three: single devices,
    groups of devices or devices subscribed to certain topics.
  • Send messages from client apps, devices can send chats, messages and acknowledgement back
    to the server using FCM’s connection channel.

As said earlier FCM can send notification messages, to send such messages, it usually uses JSON-formatted message. Such example is:
{
“to” : “bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1…”,
“notification” : {
“body” : “Islam Karimov, who crushed all opposition in the Central Asian country of Uzbekistan as its only president in a quarter-century of independence from the Soviet Union, has died of a stroke at age 78, the Uzbek government announced Friday.”,
“title” : “President Islam Karimov of Uzbekistan dies at age 78”,
“icon” : “myicon”
}
}

The user is expected to see the message with a title “President Islam Karimov of Uzbekistan dies at age 78”, and a text “Islam Karimov, who crushed all opposition in the Central Asian country of Uzbekistan…”. These kind of messages are delivered in the notification tray when the application is in the background, but can also be in the foreground if the developer wishes to do so.

For a live example of a Firebase Cloud Messaging App, download Excite Media’s own Android app at: https://play.google.com/store/apps/details?id=com.ph.excite.phnews&hl=en , which keeps you up to date with the latest of Philippine news.