You must have certifications from Google's Firebase Cloud Messaging (FCM) to send push messages to your app.
Please note that Google has deprecated the legacy APIs for sending push messages, and they will not be available after June 2024. For customers who have not migrated from the legacy APIs to the Service Account JSON file, please follow the instructions in the Mobile Engage - Firebase authentication migration guide.
Obtaining Firebase Cloud Messaging credentials
1. Log in
Log in to your developer account in the Firebase Console.
2. Create a project
If you already have a project, please proceed to Step 3. If you do not have a project, click Add Project.
Enter a name for the project and click Continue.
If the app uses Google Analytics, keep it enabled. If not, turn off the feature and click Continue. Once the project is ready, click Continue again.
3. Enabling the Firebase Messaging API
The Firebase Messaging API must be enabled before you proceed to the next step. Skipping this step may result in not sent error messages regarding undeliverable push messages. The messaging API must be enabled to ensure that push sending is working properly.
- Go to the Google Cloud Console to access the Firebase Cloud Messaging API enablement.
- Type Firebase Cloud Messaging API into the search bar, then select it from the list to access further settings.
- On the Firebase Cloud Messaging API page, click Enable to enable the API.
4. Service Account JSON file
To download the Service Account JSON file, go to the Project settings in the Firebase Console.
Select the Service Account tab and click Generate new private key.
The Service Account JSON file will be downloaded to your computer.
5. Ensuring that the correct Service Account JSON file is used
Before proceeding to the next step, double-check the downloaded JSON file.
Ensure that your Service Account JSON file looks similar to the sample provided below to avoid any issues with push authentication.
{
"type": "service_account",
"project_id": "gcp-project-id",
"private_key_id": "123456890abcdefgh",
"private_key": "-----BEGIN PRIVATE KEY-----\nabcdefgh\n-----END PRIVATE KEY-----\n",
"client_email": "user@gcp-project-id.iam.gserviceaccount.com",
"client_id": "123456890",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/user%40gcp-project-id.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
}
6. Add the Service Account JSON file to your app in Mobile Engage
In Emarsys, go to the Mobile Engage > Apps tab and click the Edit icon next the required app.
6.1. Updating Android Platform Settings already assigned to your app
Failing to update your existing apps with the new authentication method using the Google Service Account JSON file may result in push messages being reported as not sent after the June 2024 deadline and contacts not receiving them.
If you have already configured the Android Platform settings with an API key for your app, a warning sign will be displayed next to the settings, along with a warning message requiring you to update your settings.
- To modify your Android Platform settings, click the Edit icon.
- In the Update Android Settings dialog, upload the Service Account JSON file.
- When you are ready, click Save.
6.2. Adding new Android Platform Settings to your app
In the Platforms section, click Add Android.
In the Add Android Settings dialog, you need to:
- Ignore the Google Cloud Messaging API Key as the API key has been deprecated.
- Upload the previously generated Service Account JSON file.
- Set up the Channels.
- When you are ready, click Save.