Generate Firebase Credentials

Directions on how to generate a Firebase Cloud Messaging API Credentials for sending Android App Notifications.

πŸ“˜

For Android Apps, not websites

This guide is for developers implementing iZooto in an Android application for distribution on the Google Play App Store. This guide should not be used for Web Push.

A Google Service Account is a special type of account from Google that applications use to make authorised calls to a variety of APIs, including Firebase Cloud Messaging APIs. For more details, see Google's documentation on Service Accounts. To send push notifications to Android devices, you will need a Service Account to generate a private key for iZooto to utilise.

Requirements

Setup

Step 1. Create a Firebase Project

Push Notifications require a Firebase Project. If you do not have one set up yet, click Add Project and follow the directions to set up your project.

If you already have an FCM project, skip to Step 2.

Page of Projects within Firebase

Page of Projects within Firebase

Step 2. Ensure Firebase Cloud Messaging API (v1) is Enabled

If you have created a new project, this should already be enabled by default, and you can skip this step. However, if you are using an existing Firebase project, especially an older one, ensure Cloud Messaging API (v1) is enabled.

To check, click the gear icon next to Project Overview in the top left of the left-hand menu and select Project Settings. Select the Cloud Messaging tab.

Firebase gear icon submenu, showing Project Settings

Firebase gear icon submenu, showing Project Settings

If Firebase Cloud Messaging API (v1) is disabled, then click the kebab menu icon on the top right corner and open the link.

Firebase Cloud Messaging API (v1) is disabled in the image. This should be enabled for your project.

Firebase Cloud Messaging API (v1) is disabled in the image. This should be enabled for your project.

On the subsequent page, click Enable. You may need to wait a few minutes for the action to propagate to Firebase systems.

Enable Firebase Cloud Messaging API v1

Enable Firebase Cloud Messaging API v1

Step 3. Generate a Private Key JSON File

In Project Settings, go to the Service Accounts tab.

Click Generate new private key at the bottom of the page.

Service Accounts Section within Firebase

Service Accounts Section within Firebase

Click Generate Key on the warning window that appears.

Generate FCM v1 Key within Firebase

Generate FCM v1 Key within Firebase

Save the JSON file securely. This will be needed to send push notifications via iZooto.

πŸ“˜

Required Permissions

The following Service Account permissions are required for push notifications to work:

  • cloudmessaging.messages.create
  • firebase.projects.get

Step 4: Configure Your Android App on iZooto

Once you have successfully extracted the Server Key and Sender ID, proceed to add your Android app to your iZooto account.

If you have not already done so, proceed to install the iZooto SDK in your app.