e-trainiaDocs
IntegrationPush Notification

How to Config Push Notification

Site Settings → Integration → Push Notification

Use the Push Notification page under Site Settings → Integration to connect your site to Firebase Cloud Messaging (FCM). The admin panel can then send push notifications to users' web browsers.

Click Site Settings

Follow these steps in the Firebase Console before configuring push notifications here.

Click Integrations → Push Notifications → Setup

1. Create a Firebase Project

Go to the Firebase Console and click "Add project". Enter a project name, accept the terms and, if you want, turn on Google Analytics for the project. Click "Create project" and wait until it is ready.


2. Register a Web App in the Project

From the Project Overview page, click the Web icon (</>) to add a new app. Give it a nickname (for example, "Admin Panel") and click "Register app". You don't need Firebase Hosting, so skip it.

Setting up Android or iOS instead? That's done on CMS → Mobile Settings → Mobile Integration, which has its own setup steps.


3. Enable Cloud Messaging

In the Firebase Console, open Project Settings (gear icon) → Cloud Messaging tab. Check that "Firebase Cloud Messaging API (V1)" is enabled for your project. If it is disabled, click to enable it.


4. Generate a Service Account Key

Open Project Settings → Service Accounts tab. Click "Generate new private key" and confirm. A JSON file is downloaded (for example, your-project-firebase-adminsdk-xxxxx.json). It contains the credentials this admin panel needs to send push notifications.

Warning

Keep this file private.


5. Get the Web Push (VAPID) Key

Stay in Project Settings → Cloud Messaging tab, scroll to "Web configuration" → "Web Push certificates". If there is no key, click "Generate key pair". Copy the key shown. This is the VAPID key, used to send push notifications to web browsers.


6. Add Both and Save

Upload the downloaded service account JSON file (or paste its contents) and the Web Push VAPID key in the form, then click Save. This is a one-time setup. You can replace the credentials later, for example if you change your keys.


Configuration Status

StateDescription
Not ConfiguredBefore setup. Push notifications are inactive
ConfiguredAfter a successful save. Push notifications are active

Steps to Configure Notifications for Web

  1. Choose to upload the service account JSON file or paste the service account JSON into the edit field.
  2. After you paste it, the Firebase Project ID is filled in automatically.
  3. The Web Push VAPID Key is also required.
  4. Click Save.

Push Notification Panel

Status: Configured

FieldValue
Service Account•••••••••••••••••••••••••••••••••••••••••••••
Firebase Project ID••••••••••••
Web Push VAPID Key••••••••••••••••••••••••••••


Replace Credentials

After the credentials are set up, an admin can click Replace Credentials to change the service account JSON and VAPID key.

Steps to Replace Credentials

  1. Click Replace Credentials on the Push Notification Panel.
  2. The form opens with the existing values already filled in.
  3. Choose to upload a new service account JSON file or paste the new service account JSON into the edit field.
  4. After you paste it, the Firebase Project ID is updated automatically.
  5. Update the Web Push VAPID Key (required).
  6. Click Save to apply the new credentials.

Warning

Replacing credentials overwrites the current setup straight away. Check that the new service account JSON and VAPID key are correct before you save.


Web App Config Requirements

Before the notification setup is accepted, the web app config needs these fields:

FieldDescription
appIdFirebase App ID
apiKeyFirebase API Key
projectIdFirebase Project ID
authDomainFirebase Auth Domain
messagingSenderIdFirebase Cloud Messaging Sender ID

Info

You can find these values in Project Settings → General → Your apps → SDK setup and configuration → Config.

Last updated on