Configuring your app
For using Firebase
Stage 1. Create a project in Firebase and obtain a key
-
Go to the Firebase Console, click Get started with a Firebase project, and create a project.
Note
If you already have a project, go to Project settings and follow the guide starting from Step 3.
-
Go to Your Project → Project settings.
-
In Project settings, go to the Service accounts tab and click Generate new private key.
-
In the window that opens, click Generate key. The key will be downloaded as a JSON file. Save it: you will need it for AppMetrica.
-
Please make sure the Firebase Cloud Messaging API (FCM API) is enabled. If not, enable it:
-
Go to https://console.cloud.google.com/apis/library/fcm.googleapis.com.
-
Select your project and check the status of the FCM API.
-
If your FCM API is disabled, click Enable.
-
Stage 2. Add your key in the AppMetrica interface
Add the key obtained in Stage 1 in the AppMetrica interface:
- In the Applications section, select the app that you want to run push campaigns for.
- In the menu on the left, select Settings.
- Go to the Push notifications tab.
- In the Android section, next to FCM service account key, click Select file and upload the key (JSON file) obtained from Firebase.
To use Huawei Mobile Services (HMS)
Stage 1. Create and configure a project in the Huawei console
Follow all the stages in the Huawei documentation.
Alert
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.
Stage 2. Configure AppMetrica to work with HMS
Get the app ID
and app secret
from the Huawei console:
- In the list of projects in the Huawei console, select your project.
- On the project page, copy the
App ID
andApp secret
field values.
Use these keys in the AppMetrica interface:
- In the Applications section, select the app you want to run push campaigns for.
- In the menu on the left, select Settings.
- Go to the Push notifications tab.
- In the Huawei block, fill in the App ID and App secret fields with values from the Huawei console and click Submit.
See also
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.