Firebase Messaging O GCM?


I have a app in which I use Firebase Messaging , but I have battery consumption problems. And reading in the google docs , recommend that to save battery use GCM .

So my question is: What is the difference between using GCM or FirebaseMessaging ?

asked by Alberto Mier 28.11.2017 в 06:55

2 answers


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.
answered by 29.11.2017 / 02:24

Firebase Messaging is built on GCM so the memory consumption would be the same.

Google recommends that we use Firebase Messaging, because the integration is simpler and all the new features added to Firebase Messaging, not to GCM that will become obsolete later.

The memory consumption you have should be for other things, you can check this;) Optimize battery consumption app android

answered by 28.11.2017 в 17:24