Firebase Cloud Messaging (v1) Credentials Guide

In order to send notifications to your game on Android, Teak needs your Firebase Cloud Messaging (FCM V1) credentials.

In this guide, we’ll download a Service Account Key (in JSON format), and copy the Sender ID value from your Firebase console, and input those into Teak.

If you already have FCM (Legacy) setup with Teak, please see our Firebase (v1) Migration guide for instructions on ensuring a smooth rollover from Legacy credentials to v1 credentials.

You will need the following accounts to complete this step:

  • An account on the Firebase Console with an Editor or Owner role and access to your game

  • An account on Teak with access to your game

Open Project Settings  Cloud Messaging in your Firebase project.

  1. Go to your Firebase Console and open the project for your game. This must be the same project that you are using to authenticate the Firebase SDK in your game.

    If you need to confirm that you have the correct Firebase project: Open the google-services.json file from your Unity Project and find the project_number. Confirm that the value matches the Sender ID value on the Cloud Messaging tab.

  2. Click the gear icon in the upper left corner, and click Project settings.

    firebase dashboard
  3. Click on the Cloud Messaging tab.

Enable Firebase Cloud Messaging API (V1), (if it isn’t already enabled).

  1. Make sure that Firebase Cloud Messaging API (V1) is enabled. Support for FCM (Legacy) will be discontinued by Google on June 20th, 2024.

    Enabling Firebase Cloud Messaging API (V1)

    If the V1 API isn’t enabled, proceed with these steps to activate it.

    1. In the Firebase Cloud Messaging API (V1) section, click on the 3 vertical dots. ⋮

    2. Click Manage API in Google Cloud Console.

    3. In the new tab that opens, click Enable.

    4. This will load the API/Service Details page. After the page has loaded, close this tab.

    5. Return to the Firebase Console page and refresh the page.

    6. Firebase Cloud Messaging API (V1) should now be enabled.

    firebase notification settings

Copy the Sender ID to Teak

  1. In the Teak Dashboard for your game, navigate to Settings  Android.

    If you already have FCM (Legacy) setup with Teak, please see our Firebase (v1) Migration guide for instructions on ensuring a smooth rollover from Legacy credentials to v1 credentials.

  2. Click Setup Firebase Cloud Messaging (V1) to open the FCM setup modal.

  3. Copy Sender ID from Firebase to the FCM Sender ID field in the setup modal for Teak.

Leave this modal open for the next step.

Generate a Service Account Key in Firebase

  1. Back in the Firebase dashboard, click the Service accounts tab.

    firebase service accounts
  2. By default, the Firebase Admin SDK service account will be selected. This is fine for most cases.

  3. Click the Generate new private key button and confirm you want to Generate key in the popup. This will download a private key as a JSON file.

Upload the Service account private key to Teak

  1. Return to the Teak dashboard. The FCM setup modal should still be open.

  2. Click the Select private key file (JSON) and locate the private key

  3. Click Save to confirm your changes.