Migration GCM to FCM

Since SDK 4.5 version we support push notifications with FCM (Firebase Cloud Messaging). On April 10, 2018 Google deprecated the sending of push notifications with GCM. In this link you can see all the information about it.

Although Google will continue to support the tokens and keys (legacy) still in operation, it is recommended that the update be done since support for the GCM libraries will be cancelled on April 11, 2019, therefore, as time goes by, the correct functioning of push notifications will not be guaranteed.

This is a guide for migrating from GCM to FCM. If you are installing our SDK for first time take a look at our guide to see how to integrate push notifications in Android.

To migrate from GCM to FCM, follow these steps:

  1. Remove everything related with GCM
  2. Add FCM to the App

 

Remove everything related with GCM

  1. The first step is to remove the following permissions from the AndroidManifest.xml:

    Then the following receiver and service must also be removed (depending on the version of EMMA this may change)

  2. If you use the GCM dependency of your app (excluding the one in EMMA) you have to delete the following line from the build.gradle file. If you are using EMMA, in this case the new version 4.5 already excludes it.

 

Add FCM to the App

  1. Add the following service to AndroidManifest.xml:

  2. Add the following dependency to the build.gradle located at the root of the project:

    In the build.gradle of the app add the Firebase dependency:

  3. Add the google-services.json in the /app directory within the project. You can get more info here to know hot to get the file. Without this file push notifications will not work, it is mandatory to add it.
  4. In the case of using a key server "Legacy" is still valid and supported by Google, although it is recommended to use the FCM Server Key.
  5. For more info you can see the Android push notification integration documentation.
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.