Migrating from GCM to Firebase
Since the AppMetrica Push SDK version 0.2.0, it uses the Firebase Cloud Messaging (FCM) service to send push messages on the Android platform.
This section explains the steps for migrating the application from Google Cloud Messaging to Firebase Cloud Messaging.
Step 1. Import a project
Import a Google project (if you used Google APIs to create a project):
- Go to the Firebase console.
- Click the Add project button.
- In the drop-down list, select the name of the project you are planning to run push campaigns for.
- Select the country your organization is officially registered in and click Add Firebase.
- Click Add Firebase to your Android app and follow the instructions.
Step 2. Configuring your app
Edit the AndroidManifest.xml
file:
Rename
ymp_gcm_project_number
toymp_gcm_default_sender_id
and get the following result:<meta-data android:name="ymp_gcm_default_sender_id" android:value="number:SENDER_ID"/>
Copied to clipboardSENDER_ID
— The unique ID of the sender in Firebase. You can find it in the Firebase console: go to and copy the value of the Sender ID field.Add the following to the
application
element:<meta-data android:name="ymp_firebase_default_app_id" android:value="APP_ID"/>
Copied to clipboardAPP_ID
— ID of the app in Firebase. You can find it in the Firebase console: go to the Project settings. In the Your application section copy the value of the application ID field.