Firebase Cloud Messaging

Last updated

Firebase Cloud Messaging
Developer(s) Firebase
Programming language(s) -
Application(s) Notification service
StatusOffline[ citation needed ]
LicenseAccess
Website firebase.google.com/products/cloud-messaging/

Firebase Cloud Messaging (FCM), formerly known as Google Cloud Messaging (GCM), is a cross-platform cloud service for messages and notifications for Android, iOS, and web applications, which as of May 2023 can be used at no cost. [1] Firebase Cloud Messaging allows third-party application developers to send notifications or messages from servers hosted by FCM to users of the platform or end users.

Contents

The service is provided by Firebase, a subsidiary of Google. On October 21, 2014, Firebase announced it had been acquired by Google for an undisclosed amount. [2] The official Google Cloud Messaging website points to Firebase Cloud Messaging (FCM) as the new version of GCM. [3] Firebase is a mobile platform which supports users in developing mobile and web applications. Firebase Cloud Messaging is one of many products which are part of the Firebase platform. On the platform users can integrate and combine different Firebase features in both web and mobile applications.

History

Firebase Cloud Messaging (FCM) is part of the Firebase platform, which is a cloud service model that automates backend development or a Backend-as-a-service (BaaS). After the Firebase company was acquired by Google in 2014, some Firebase platform products or technologies were integrated with Google’s existing services. Google’s mobile notification service Google Cloud Messaging (GCM) was replaced by FCM in 2016. On April 10, 2018, GCM was removed by Google and on May 29, 2019, the GCM server and client API were deprecated. [4] FCM has become the replacement for GCM. However, FCM is compatible with existing Google Software Development Kits (SDK). [5]

Firebase Cloud Messaging is a cross-platform messaging service on which the user can deliver messages without cost. FCM is compatible with various platforms including Android and iOS. [6] Google launched support for web applications on October 17, 2016 including mobile web application. [7] On FCM, third party application developers can send push notifications and messages via an application programming interface (API) to end users. [8] After users enable consent to receive push notifications, users are able to receive real time information or data for syncing.

Development

FCM inherits the core infrastructure of GCM, however, it simplifies the development of the client side. GCM and FCM offer encryption, push notification and messaging, native Android and iOS SDK support. Both require a third-party entity between the client application and the trusted environment which may create delays in the communication path between the mobile terminal and application server. [8] FCM supports server protocols HTTP and XMPP which are identical to GCM protocols.

Developers are not required to write individual registrations or subscripting retrying login in the client application. [4] FCM and GCM handle messages through the same instructions, however, instead of GCM connection servers, messages are passed through FCM servers. The FCM Software Development Kit (SDK) excludes writing individual registration or subscription retry logic for a shortened client development process. The FCM SDK provides a new notification solution allowing developers to use the serverless Firebase Notifications on a web console, based on Firebase Analytics insights. FCM enables unlimited upstream and downstream messages to be sent. [6]

Key Capabilities

Firebase Cloud Messaging has three main capabilities. The first capability is that FCM allows the user to receive notification messages or data messages which can be deciphered by the application code. The second capability is message targeting. Messages are able to be sent to the client application through different methods; from the FCM platform to individual devices, specified device groups or devices which are subscribed to particular topic domains. The third key capability is the connection channel from client applications to the server. FCM allows messages of various types to be sent from selected devices or client apps via the FCM channel. [9]

Technical Details

Firebase Cloud Messaging sends notifications and messages to devices which have installed specific Firebase-enabled apps. Adding support for FCM to an application requires multiple steps: add support to the Android Studio project, obtain registration tokens and implement handlers to identify message notifications. [10] The message notifications can be sent via the Firebase console with a select user segmentation option.

FCM Architecture

The FCM Architecture includes three components: FCM connection server, a Trusted environment with an application server based on HTTP or XMPP and cloud functionality, and a Client application. Sending and receiving messages require a secured environment or server to build, direct and send messages, and an iOS, Android or web client application to receive messages. [11] There are two types of messages developers can send with FCM; notification messages and data messages. Notification messages are messages displayed on the device by FCM and are automatically managed by the FCM SDK. Data messages are processed by the client application. [12] Therefore, Notification messages are used when the developer requires FCM to handle the notification display for the client applications. Data messages will be used when the developer requires the messages to be processed on the client application.

Firebase cloud messaging architecture Firebase cloud messaging architecture.png
Firebase cloud messaging architecture

FCM can deliver target messages to applications via three methods: to a single device, to a device group or to devices which are subscribed to topics. Developers build and send targeted messages to a select group of users on the ‘Notification composer.’ [10] Messages sent with FCM are integrated with Google Analytics to track user conversion and engagement. [13]

Implementation

The implementation process has two key components. First, a secure environment to send and receive messages is required for FCM or other application servers to facilitate message transaction. Second, a client application of possible types, iOS, Android or web (javaScript), which is also compatible with the selected platform service is needed.

The implementation path for FCM is initiated with the FCM SDK setup following the instructions prescribed for the decided platform. Following setup, the client application must be developed. On the client app, add message handling, topic subscription logic and other required features. During this step, test messages can also be sent from the Notifications composer. The application server is developed next to build the sending logic. The base server environment is created without code. [4]

Architecture Flow

Registration of the device and setting it up to enable message reception from FCM is first required. The client application instance will be registered and assigned a registration token or FCM Token, which is issued by the FCM connection servers that will provide the application instance (app instance) a unique identifier. The app instance is then able to send and receive downstream messages. Downstream messaging refers to the sending of a push notification from the application server towards the client application. This process involves four steps. First, after a message is created on the Notifications composer or in another secure environment, a request for the message will be sent to the FCM backend. Second, the FCM backend will receive and accept the message request and prepare the messages for each specified topic, create message metadata such as a message ID and send it to a transport layer, specific to the platform. Third, the message will be sent through the platform-specific transport layer to an online device. The platform-level transport layer is responsible for routing the message to a specific device, handling the delivery of the message and applying specific configurations to the platform. Fourth, the client application will receive the notification or message via their device. [14]

Additional Features and Tools

Analytics

Firebase offers free and unrestricted analytics tools to assist the user gain insights into the 'ad click' & 'application usage' of end customers. In conjunction with other Firebase features, Firebase Analytics allows the user to explore and use on a range of functionalities such as click-through rates to app crashes. [15]

Firebase Remote Config

It is a simple key-value store that lives in the cloud and enables the user to implement modifications which can be read by the application. The Firebase Remote Config also includes an audience builder, in addition to the basic feature, which helps the user create custom audiences and perform A / B testing. [15]

Cross-Platform Support

APIs packaged into single SDKs for iOS, Android, JavaScript and C++ in conjunction with the cross-platform support provided by FCM allow the developer to expand across different platforms without infrastructure modification. [15]

Web Push Support

Developers can implement the standard IETF Web Push APIs and being to target web browsers. On Chrome, developers can send messages to Chrome on Android or Chrome pages in Mac, Windows and Linux. Added features for web push support include Topic Messaging and the ability to send messages to Topic Combinations. [15]

Topic Messaging

Developers can send a single message to multiple devices. It is a method of notification to users with common interest topics such as sports events, artists, music genres. Developers need to publish a message to FCM, which is automatically delivered to devices subscribed to the select topic. Subscriber count on a single topic or multiple topics are not limited on the application. [15]

Topic Combination Messaging

If users are subscribed to different topics, to prevent publishing the same message across different topics and users from receiving duplicate messages, developers can use the updated API. Developers can set specific conditions for FCM to deliver the message only to users who meet the condition criteria. [15]

Message Delivery Reports

Message Delivery Reports (MDR) are generated by FCM's reporting tool which allows developers to obtain analytical insights into the message delivery. In the MDR, developers can evaluate the reach of the sent messages to specific users by viewing the data for messages to different FCM SDKs (Android, iOS). [16]

Notification Funnel Analysis

A Notification Funnel Analysis (NFA) is built into the FCM platform. By using this tool, developers can view user behaviour and trends from data around responses to particular notifications. The types of notification data which can be analysed are "Notifications Sent", "Notifications Opened" and number of unique users. An analysis report can be pulled from the NFA. Developers can also customise and build the notification funnels. [16]

Key Concerns

Security Concerns

FCM shortens the design and implementation process for mobile applications. Due to the available functionality of sending test messages through the Notifications Composer in the Firebase console, the testing process is also shortened. Cloud-based messaging solutions also have security and privacy risks which need to be mitigated and considered before implementation into a project. The development of cloud computing involves an open network structure and elastic pooling of shared resources which increases the need for cloud security measures to be established. [17]

A security concern is the potential exploitation of server keys which are stored in the FCM’s Android application package (APK) files. If exploited, this allows the distribution of push notification messages to any and all users on the Firebase platform. GCM has previously reported security vulnerabilities where phishing and malicious advertisement activities have occurred.

Protection against security threats involves multiple steps and can lead to additional implications. Deactivating the Cloud Messaging service will prevent immediate transactions. However, this could potentially stop other applications installed on the blocked device which rely on the FCM service. [17] A possible solution is to block a specific notification channel or unsubscribe from a topic. Other solutions involve setting up message traffic notification systems to detect malicious information being messaged through the FCM service platform. [18] To implement this solution additional steps are required. The user needs to identify at the start, the connection channel or topic potentially used by the malicious application.

Privacy Concerns

Cloud-based messaging also poses privacy risks and issues. Black hat hackers may be able to breach the security of the Firebase Cloud Messaging platform and acquire the registration ID of the user’s application or other sensitive information. Security compromise examples include private messages on a user’s social media account being pushed to the hacker’s device.To ensure the privacy of the platform, the user can build end-to-end protection schemes around the open communication channels provided by the Cloud Messaging Services, which are unsecure. FCM provides users with payload encryption. [17]

Related Research Articles

A software development kit (SDK) is a collection of software development tools in one installable package. They facilitate the creation of applications by having a compiler, debugger and sometimes a software framework. They are normally specific to a hardware platform and operating system combination. To create applications with advanced functionalities such as advertisements, push notifications, etc; most application software developers use specific software development kits.

<span class="mw-page-title-main">Google Talk</span> Instant messaging service

Google Talk was an instant messaging service that provided both text and voice communication. The instant messaging service was variously referred to colloquially as Gchat, Gtalk, or Gmessage among its users.

Push technology, also known as server push, refers to a method of communication on the Internet where the initial request for a transaction is initiated by the server, rather than the client. This approach is different from the more commonly known "pull" method, where information transmission is requested by the receiver or client.

Push email is an email system that provides an always-on capability, in which when new email arrives at the mail delivery agent (MDA), it is immediately, actively transferred (pushed) by the MDA to the mail user agent (MUA), also called the email client, so that the end-user can see incoming email immediately. This is in contrast with systems that check for new incoming mail every so often, on a schedule. Email clients include smartphones and, less strictly, IMAP personal computer mail applications.

Mobile app development is the act or process by which a mobile app is developed for one or more mobile devices, which can include personal digital assistants (PDA), enterprise digital assistants (EDA), or mobile phones. Such software applications are specifically designed to run on mobile devices, taking numerous hardware constraints into consideration. Common constraints include CPU architecture and speeds, available memory (RAM), limited data storage capacities, and considerable variation in displays and input methods. These applications can be pre-installed on phones during manufacturing or delivered as web applications, using server-side or client-side processing to provide an "application-like" experience within a web browser.

Mobile device management (MDM) is the administration of mobile devices, such as smartphones, tablet computers, and laptops. MDM is usually implemented with the use of a third-party product that has management features for particular vendors of mobile devices. Though closely related to Enterprise Mobility Management and Unified Endpoint Management, MDM differs slightly from both: unlike MDM, EMM includes mobile information management, BYOD, mobile application management and mobile content management, whereas UEM provides device management for endpoints like desktops, printers, IoT devices, and wearables as well.

<span class="mw-page-title-main">Apple Push Notification service</span> Notification service created by Apple

Apple Push Notification service is a platform notification service created by Apple Inc. that enables third party application developers to send notification data to applications installed on Apple devices. The notification information sent can include badges, sounds, newsstand updates, or custom text alerts. It was first launched with iOS 3 on June 17, 2009. APNs support for local applications was later added to the Mac OS X API beginning with the release of Mac OS X 10.7 ("Lion"). Support for website notifications was later added with the release of Mac OS X 10.9 ("Mavericks").

<span class="mw-page-title-main">Android Debug Bridge</span> Tool for debugging Android-based devices

The Android Debug Bridge is a programming tool used for the debugging of Android-based devices. The daemon on the Android device connects with the server on the host PC over USB or TCP, which connects to the client that is used by the end-user over TCP. Made available as open-source software under the Apache License by Google since 2007, features include a shell and the possibility to make backups. The adb software is compatible with Windows, Linux and macOS. It has been misused by botnets and other malware, for which mitigations were developed such as RSA authentication and device whitelisting.

iMessage Instant messaging service by Apple

iMessage is an instant messaging service developed by Apple Inc. and launched in 2011. iMessage functions exclusively on Apple platforms – including macOS, iOS, iPadOS, and watchOS – as part of Apple's broader strategy of vendor lock-in.

A notification service provides means to send a notice to many persons at once. For example, if a flood were likely, residents of a community could be warned it's time to evacuate. If a school were suddenly closed for the day, students or parents could be told not come to school, or told to report to an alternate location. American Airlines can notify passengers by cellphone two hours before a flight's departure with information on the flight's status and gate number.

<span class="mw-page-title-main">Android Cloud to Device Messaging</span> Defunct mobile notification service

Android Cloud to Device Messaging, or C2DM, is a defunct mobile notification service that was developed by Google and replaced by the Google Cloud Messaging service. It enabled developers to send data from servers to Android applications and Chrome extensions. C2DM originally launched in 2010 and was available beginning with version 2.2 of Android. On June 27, 2012, Google unveiled the Google Cloud Messaging service aimed at replacing C2DM, citing improvements to authentication and delivery, new API endpoints and messaging parameters, and the removal of API rate limits and maximum message sizes. Google announced official deprecation of the C2DM service in August 2012, and released documentation to assist developers with migrating to the new service. The C2DM service was discontinued for existing applications and completely shut down on October 20, 2015.

<span class="mw-page-title-main">Android Froyo</span> Sixth version of the Android operating system

Android Froyo is the sixth version of Android and is a codename of the Android mobile operating system developed by Google, spanning versions between 2.2 and 2.2.3. Those versions are no longer supported.

<span class="mw-page-title-main">ChatON</span> Mobile communication service

ChatON was a global mobile communication service provided by Samsung Electronics from September 2011 to March 2015.

<span class="mw-page-title-main">Google Cloud Messaging</span> Mobile notification service

Google Cloud Messaging (GCM) was a mobile notification service developed by Google that enables third-party application developers to send notification data or information from developer-run servers to applications that target the Google Android Operating System, as well as applications or extensions developed for the Google Chrome internet browser. It was available to developers free of charge. The GCM Service was first announced in June 2012 as a successor to Google's now-defunct Android Cloud to Device Messaging (C2DM) service, citing improvements to authentication and delivery, new API endpoints and messaging parameters, and the removal of limitations on API send-rates and message sizes. It has been superseded by Google's Firebase Cloud Messaging (FCM) on May 29, 2019.

Microsoft mobile services are a set of proprietary mobile services created specifically for mobile devices, they are typically offered through mobile applications and mobile browser for Windows Phone platforms, BREW, and Java. Microsoft's mobile services are typically connected with a Microsoft account and often come preinstalled on Microsoft's own mobile operating systems while they are offered via various means for other platforms. Microsoft started to develop for mobile computing platforms with the launch of Windows CE in 1996 and later added Microsoft's Pocket Office suite to their Handheld PC line of PDAs in April 2000. From December 2014 to June 2015, Microsoft made a number of corporate acquisitions, buying several of the top applications listed in Google Play and the App Store including Acompli, Sunrise Calendar, Datazen, Wunderlist, Echo Notification Lockscreen, and MileIQ.

Backend as a service (BaaS), sometimes also referred to as mobile backend as a service (MBaaS), is a service for providing web app and mobile app developers with a way to easily build a backend to their frontend applications. Features available include user management, push notifications, and integration with social networking services. These services are provided via the use of custom software development kits (SDKs) and application programming interfaces (APIs). BaaS is a relatively recent development in cloud computing, with most BaaS startups dating from 2011 or later. Some of the most popular service providers are AWS Amplify and Firebase.

Firebase, Inc. is a set of backend cloud computing services and application development platforms provided by Google. It hosts databases, services, authentication, and integration for a variety of applications, including Android, iOS, JavaScript, Node.js, Java, Unity, PHP, and C++.

PubNub is a Real-time Communication Platform and real-time infrastructure-as-a-service (IaaS) company based in San Francisco, California. The company makes products for software and hardware developers to build real-time web, mobile, and Internet of Things (IoT) applications.

<span class="mw-page-title-main">Windows Push Notification Service</span> Notification service developed by Microsoft

Windows Push Notification Service is a notification service developed by Microsoft for all devices running Microsoft Windows platforms. It allows for developers to send push data to Windows and Universal Windows Platform applications which implement the feature. Designed as a successor to the Microsoft Push Notification Service, it was first supported on Windows 8 and subsequently on Windows Phone 8.1 upon its release.

References

  1. "Firebase Cloud Messaging". Google Developers. Retrieved April 4, 2021.
  2. Tamplin, James. "Firebase is Joining Google!". Firebase, Inc. Retrieved October 21, 2014.
  3. "Google Cloud Messaging - official website" . Retrieved July 20, 2016.
  4. 1 2 3 Kantamani, S. (2020). Firebase Cloud Messaging. Retrieved 7 September 2020, from https://medium.com/developermind/using-firebase-cloud-messaging-for-remote-notifications-in-ios-d35de1dc67b2
  5. Tondolo, Musa (July 27, 2018). "Understanding Firebase: Part 1(Firebase Cloud Messaging)". Medium. Retrieved November 17, 2020.
  6. 1 2 Moroney, L. (2017). Firebase Cloud Messaging. In The Definitive Guide to Firebase (pp. 163-188). Apress, Berkeley, CA.
  7. Novet, J. (2016). Google launches Firebase Cloud Messaging for the web. Retrieved 7 October 2020, from https://venturebeat.com/2016/10/17/google-launches-firebase-cloud-messaging-for-the-web/
  8. 1 2 Albertengo, G., Debele, F. G., Hassan, W., & Stramandino, D. (2020). On the performance of web services, google cloud messaging and firebase cloud messaging. Digital Communications and Networks, 6(1), 31-37.
  9. "Firebase Cloud Messaging". Firebase. Retrieved November 16, 2020.
  10. 1 2 Yilmaz, Y. S., Aydin, B. I., & Demirbas, M. (2014, December). Google cloud messaging (GCM): An evaluation. In 2014 IEEE Global Communications Conference (pp. 2807-2812). IEEE.
  11. Mokar, M. A., Fageeri, S. O., & Fattoh, S. E. (2019, September). Using Firebase Cloud Messaging to Control Mobile Applications. In 2019 International Conference on Computer, Control, Electrical, and Electronics Engineering (ICCCEEE) (pp. 1-5). IEEE
  12. "About FCM messages". Firebase. Retrieved November 17, 2020.
  13. "Google Analytics for Firebase". Firebase. Retrieved May 15, 2023.
  14. "FCM Architectural Overview". Firebase. Retrieved November 17, 2020.
  15. 1 2 3 4 5 6 Sharma, R. (2020). What is GCM and FCM? (Differences and Limitations). Retrieved 2 October 2020, from https://www.izooto.com/blog/everything-that-you-need-to-know-about-firebase-cloud-messaging-platform
  16. 1 2 "Understanding message delivery". Firebase. Retrieved November 17, 2020.
  17. 1 2 3 Esposito, Christian; Palmieri, Francesco; Choo, Kim-Kwang Raymond (March 2018). "Cloud Message Queueing and Notification: Challenges and Opportunities". IEEE Cloud Computing. 5 (2): 11–16. doi:10.1109/mcc.2018.022171662. ISSN   2325-6095. S2CID   19248242.
  18. Li, Na; Du, Yanhui; Chen, Guangxuan (December 2013). "Survey of Cloud Messaging Push Notification Service". 2013 International Conference on Information Science and Cloud Computing Companion. IEEE. pp. 273–279. doi:10.1109/iscc-c.2013.132. ISBN   978-1-4799-5245-8. S2CID   15771293.