Failing to update your existing apps migrating to 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.
1. Introduction and prerequisites
This document guides existing customers through migrating the Google's Firebase Cloud Messaging (FCM) authentication method from legacy API key to Service Account JSON file upload, as Google has deprecated the legacy APIs for sending push messages, and these APIs will not be available after June 2024.
To ensure a smooth transition, 2 tasks need to be completed:
- You must ensure your Android apps are using Mobile SDK version 3.7.0 or later. If not, please update the SDK. Doing so as soon as possible is highly recommended to provide end-users time to update the app with the latest SDK version.
- A Service Account JSON file must be uploaded for each of the mobile Android apps registered in the Emarsys account. This JSON file is needed for authentication with the new API. This page describes the steps to complete this task.
2. Ensuring that the Firebase Messaging API is enabled
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 works properly.
- Go 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 the settings.
- On the Firebase Cloud Messaging API page, click Enable to enable the API.
3. Obtaining the Firebase Service Account JSON file
Here is what you need to do to obtain the Firebase Service Account JSON file:
- Log in to your developer account using the Firebase Console.
- Select your mobile app project.
- Select project settings by clicking on the cogwheel icon in the top left of the screen.

- Select the Sevice accounts tab and click Generate new private key.
The required Service Account JSON file will be downloaded to your local device.
4. 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 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"
}
5. Uploading the Firebase Service Account JSON file
- In Emarsys, select Channels and click Mobile Engage.
- Select the Apps tab and click the Edit icon next to the app you need to update.
- Click the Edit icon next to Android Platform.

- Upload the previously downloaded JSON file to the Google Service Account JSON file section.
Do not delete the Google Cloud Messaging API key if it is present.

- When you are ready, click Save.
6. How push sending works after the migration
The new authentication method via the JSON takes effect once:
- The Google Service Account JSON file is uploaded to Emarsys via the Android app's authentication settings and
- A new version of your app that uses Mobile SDK version 3.7.0 or later is rolled out.
Once our sending system detects that a contact's device uses Mobile SDK version 3.7.0 or later AND the Service Account JSON file exists, the new Google Messaging API will be used to send the push notification to that particular contact.
For all other cases, as long as Google's legacy API is supported, the legacy API and the API Key will be used to send push notifications.
This way, we can ensure that sending push messages is possible with both methods during the transition period and while Google supports the legacy API.