Skip to content

Migrating to the Firebase Cloud Messaging API

Learn how to migrate from Google’s deprecated Cloud Messaging API to their fully-supported Firebase Cloud Messaging (FCM) API. For more information, see Google’s Firebase FAQ - 2023.

Step 1: Verify your Sender ID

First, open Braze, then select  Settings > App Settings.

The "Settings" menu open in Braze with "App Settings" highlighted.

Under your Android app’s Push Notification Settings, check the number in the Firebase Cloud Messaging Sender ID field—you’ll compare this to the one in your Firebase project next.

The form for "Push Notification Settings".

Next, open Firebase Console, then select  Settings > Project settings.

The Firebase project with the "Settings" menu open.

Select Cloud Messaging. Under Cloud Messaging API (Legacy), verify the Sender ID matches the one listed in your Braze dashboard.

The Firebase project's "Cloud Messaging" page with the "Sender ID" highlighted.

Step 2: Create a service account

Next, create a new service account, so Braze can make authorized API calls when registering FCM tokens. In Google Cloud, go to Service Accounts, then choose your project. On the Service Accounts page, select Create Service Account.

A project's service account home page with "Create Service Account" highlighted.

Enter a service account name, ID, and description, then select Create and continue.

The form for "Service account details."

In the Role field, find and select Firebase Cloud Messaging API Admin from the list of roles. For more restrictive access, create a custom role with the cloudmessaging.messages.create permission, then choose it from the list instead. When you’re finished, select Done.

The form for "Grant this service account access to project" with "Firebase Cloud Messaging API Admin" selected as the role.

Step 3: Generate JSON credentials

Next, generate JSON credentials for your FCM service account. On Google Cloud IAM & Admin, go to Service Accounts, then choose your project. Locate the FCM service account you created earlier, then select  Actions > Manage Keys.

The project's service account homepage with the "Actions" menu open.

Select Add Key > Create new key.

The selected service account with the "Add Key" menu open.

Choose JSON, then select Create.

The form for creating a private key with "JSON" selected.

Step 4: Upload your JSON credentials to Braze

In Braze, select  Settings > App Settings.

The "Settings" menu open in Braze with "App Settings" highlighted.

Under Push Notification Settings, select Upload JSON File, then choose the file you generated earlier. When you’re finished, select Save.

The form for "Push Notification Settings" with the private key updated in the "Firebase Cloud Messaging Server Key" field.

HOW HELPFUL WAS THIS PAGE?
New Stuff!