What is the difference between using GCM (Google Cloud Messaging) or FCM (Firebase Cloud Messaging)?
Actually it should not be an option to implement GCM since must be migrated to FCM , you can check the message that indicates what I said, this by entering the Google Cloud Messaging documentation
Firebase Cloud Messaging (FCM) is the new version of GCM. Inherit the
GCM infrastructure is reliable and scalable, as well as new
characteristics! See the frequently asked questions to get more
information. If you are integrating messages into a new application,
start with FCM. GCM users strongly recommended
upgrade to FCM to benefit from the new functions of FCM today
and in the future. Before you leave, visit our survey to
GCM and FCM developers to give us their opinion!
Although FCM inherits from the GCM infrastructure, features such as the memory consumption between one and another implementation are not the same , in fact the battery consumption using FCM is one of the improvements since it is better optimized with respect to GCM.
The differences between GCM and FCM are:
-
FCM Simplifies customer development. You no longer have to write a registration or subscription retry logic. OnTokenRefresh () method:
-
Enables a new server-less notification solution with a web console, Firebase Notifications. With Firebase notifications, anyone can send notifications to specific audiences based on Firebase Analytics statistics. They can then evaluate the effectiveness of the notifications by evaluating the Notification Funnel Analysis incorporated in the console.
-
If you have implemented GCM, when you migrate to FCM you will not need to make any changes on the server side for the update. The service protocol has not changed. However, keep in mind that all new server improvements will be documented in the FCM server documentation.
Migrating client from GCM to FCM
Regarding battery consumption FCM is better optimized with respect to GCM, however these considerations apply for both GCM and FCM
Configuring the priority of a message
You have two options for assigning a delivery priority to descending messages: normal and high priority. The delivery of messages with normal or high priority works as follows:
- Normal priority. This is the default priority for data messages. Messages with normal priority will not open network connections on an inactive device and your message may be delayed to conserve the battery. For less urgent messages, such as notifications of new emails or other data to synchronize, select the normal priority of delivery.
- High priority. This is the default priority for notification messages. FCM attempts to deliver high priority messages immediately, allowing the FCM service to activate an inactive device when possible and open a network connection to your app's server. In general, apps with voice call alerts, instant messaging or chat, for example, need to open a network connection and make sure that FCM sends the message to the device without delay. Set the high priority if the message is urgent and needs the immediate interaction of the user, but keep in mind that setting the messages with high priority consumes more battery in comparison with the messages with normal priority.