Documentation: Push Notifications Onsite Messaging REST API
  1. Documentation
  2. Android App Push Notification
  3. Setup Firebase Credentials

Android: Getting Firebase Credentials

For sending push notifications to an Android app, you need to create a Firebase account and then setup Firebase Cloud Messaging Credentials. This guide will help you to generate the required Service Account JSON and uploading to your app.

Requirements - Before You Begin

Step 1: Create a Firebase Project

Android Push Notifications requires a Firebase Project. If you don't have one, follow the below steps otherwise jump to Step 2.

  • Go to Firebase Console
  • Click Add project.
    Add Project - Firebase Console
  • To add Firebase resources to an existing Google Cloud project, enter its project name or select it from the dropdown menu.

    OR

    To create a new project, enter the project name (optionally edit the project ID displayed below the project name). Then click Continue.
    Note: If prompted, review and accept the Firebase terms and click Continue.

    Firebase Project Setup - Add Project Name
  • Make sure to enable Google Analytics (recommended), so that you can track PushAlert events. Then click continue.
    Firebase Project Setup - Enable Analytics
  • In "Configure Google Analytics", select an existing Google Analytics account or create a new one.
  • Click Create Project
    Firebase Project Setup - Create Project

Step 2: Enable Firebase Cloud Messaging API (V1)

  • For new projects, Firebase Cloud Messaging API (V1) is enabled by default. If you're using an older or existing Firebase project, check if it's enabled.

    Check Firebase Cloud Messaging API Status

    Go to "Project settings" by clicking the Gear icon near "Project Overview," then navigate to the "Cloud Messaging" tab.

    Enable Firebase Cloud Messaging API (V1)

    If the API is disabled, click the overview menu in the top-right corner to access the "Enable" link. Activation may take a few minutes to process.

    Enable Firebase Cloud Messaging API (V1) - Google Cloud Console

Step 3: Generate a Private Key JSON file

  • In your Firebase "Project settings," head to the "Service accounts" tab.

    Generate Private Key JSON File for Firebase Cloud Messaging

    Click "Generate new private key" and confirm the warning prompt by clicking the Generate Key button. Save the generated JSON file securely, as it will be needed later.

    Save Private Key JSON File

Step 4: Configure your Android app in the PushAlert Dashboard

  • If you are adding a new Android App to the PushAlert dashboard, you can upload the JSON file generated above directly.

    If you heve already added your Android app project to your dashboard here, then head to Settings > App and upload the generated Service Account JSON. Then save Settings.