Configuring an Android application to send push notifications

For using Firebase

Step 1. Create a project in Firebase

  1. Go to the Firebase Console and choose an action:

    Create a new project (if this is your first project)
    1. Enter a name for the project.
    2. Select the country your organization is officially registered in and click Create project.
    Import a Google project (if you used Google APIs to create a project)
    1. In the drop-down list, select the name of the project you are planning to run push campaigns for.
    2. Select the country your organization is officially registered in and click Add Firebase.
  2. Click Add Firebase to your Android app and follow the instructions.

Step 2. Configure AppMetrica to work with FCM

Get a server key for using Firebase Cloud Messaging:

  1. In the Firebase Console, select the project you are planning to run push campaigns for.
  2. In the menu on the left, click next to the project name and go to the Project Settings section.
  3. Go to the Cloud Messaging tab.
  4. In the Cloud Messaging API block, select  → Manage API in Google Cloud Console → Enable.
  5. Go back to the Cloud Messaging tab.
  6. In the Cloud Messaging API block, copy the value of the Server key field.

Use this key in the AppMetrica interface:

  1. In the Applications section, select the app that you want to run push campaigns for.
  2. In the menu on the left, select Settings.
  3. Go to the Push notifications tab.
  4. In the Android section, enter the value you copied from the Firebase Console in Server key and click Submit.

To use Huawei Mobile Services (HMS)

Step 1. Create and configure a project in the Huawei console

Follow all the steps in the Huawei documentation.

Attention. Make sure that Configuring the Signing Certificate Fingerprint specifies SHA-256 certificate fingerprint for all app signatures, including the debug version. Otherwise, the device can't receive push notifications.

Step 2. Configure AppMetrica to work with HMS

Get the app ID and app secret from the Huawei console:

  1. In the list of projects in the Huawei console, select your project.
  2. On the project page, copy the App ID and App secret field values.

Use these keys in the AppMetrica interface:

  1. In the Applications section, select the app that you want to run push campaigns for.
  2. In the menu on the left, select Settings.
  3. Go to the Push notifications tab.
  4. In the Huawei block, fill in the App ID and App secret fields with values from the Huawei console and click Submit.

If you didn't find the answer you were looking for, you can use the feedback form to submit your question. Please describe the problem in as much detail as possible. Attach a screenshot if possible.