On April 10, 2018, Google deprecated GCM. The GCM server and client APIs were removed on May 29, 2019. Migrate GCM apps to Firebase Cloud Messaging (FCM), which inherits the reliable and scalable GCM infrastructure, plus many new features.
NOTE: iOS has a different Push Notification system which does not require the migration to Firebase and is not affected by the GCM changes. iOS has its own Apple Push Notification service.
1. How this change affect my Android app?
- New Android Applications created on App Domination will use by default Firebase Cloud Messaging.
- Existing Android Apps created on App Domination which didn't use Push Notification feature yet will use Firebase Cloud Messaging at the next submission process.
- Existing Android Apps created on App Domination which used Push Notification Service already, will be able to use further Google Cloud Messaging ( GCM Deprecated ) with the possibility to Migrate to FireBase Cloud Messaging ( FCM ).
If you migrate Firebase or it is a new application it will be required for you to provide Firebase details.
2. Required details for Firebase
The required Firebase details are:
1. Legacy server key
2. google-services.json
This is an example of an old application with which you can migrate to Firebase:
This is a new application for which Firebase details are required:
You will have to find the Legacy server key which can be found in Firebase section General settings of the application -> Cloud Messaging
3. How to get the Legacy server key and JSON file?
First of all you will have to create a new project in your Firebase section.
Once created you will be able to add to this project your application ID.
NOTE! You can add applications in one project, no need to create a separate project for each application.
In this step you will have to provide the Package Name and Application Name:
Package name is set during submission process for your application. If the application is submitted already then it can be found in your Application Dashboard.
Once done you will have to download the google-services.json file (Needs to be uploaded during submission process in Push Notifications step next to the Legacy server key field):
Next proceed with all steps and then you can skip the last check:
It will be checked after you will integrate fully the Firebase in your app.
Next you will have to get the Legacy Server Key:
In General settings go to Cloud Messaging and copy the Legacy server key (Needs to be copied to Legacy server key field during submission process in Push Notifications step):
4. Where to add the Legacy server key and JSON file?
The details have to be added here during submission process in Push Notifications step:
Now you can request the app and use Firebase Push Notifications.
5. Mentions
The Legacy Server Key refers to the project, so yes, it can be used for several apps. Make sure to download and upload the json file in separate for each app. For each application once added to Firebase you will need to generate a new json file, which will include all package names and also the new added one. If you will use the older json file it will not include the new package name from the new app and for it the messaging will not work. Json same as Legacy Server Key file is added per project and is not created per app. It includes Firebase Analytics and Firebase Cloud Messaging information for all applications added to the current project. As a result all details for all apps from project are kept in one file. If you do add a new application after you have downloaded the json file, you will need to download the latest one holding the information for your new added application. Still the json file and Legacy Server Key has to be uploaded and added for each app in separate. This is done in order to separate active Firebase apps from simple no Firebase apps. If you do add a wrong json file (which does not include your app package name) the build will fail. That's why we recommend to make sure you have the latest json file which will include your application package name.
You can find the Firebase Analytics tutorial here?