Back to marketplace
59

Push Notifications (Firebase)

Enables your users to receive push notifications from your network.

Installation

1. Create a Google Firebase account and start a new project.

Firebase Setup - Step 1

2. Navigate to Project Overview > Project Settings.

Firebase Setup - Step 2

3.1. Under the General tab, select the option to create a Web App.

Firebase Setup - Step 3.1

3.2. Name your app and click Register App.

Firebase Setup - Step 3.2

3.3. Copy the highlighted information from your App’s Firebase Configuration and paste it into the Modules Configuration as follows: apiKey = Web API Key, messagingSenderId = Sender ID, and appId = Web App ID.

Firebase Setup - Step 3.3

4.1. In the Cloud Messaging tab, select "Generate Key Pair".

Firebase Setup - Step 4.1

4.2. Copy the highlighted information from your Web Push Certificates and paste it into the Modules Configuration as follows: Key pair = Key Pair from the Web Push certificates

Firebase Setup - Step 4.2

5.1. In the Cloud Messaging tab, under Firebase Cloud Messaging API, click on "Manage Service Accounts".

Firebase Setup - Step 5.1

5.2. Under Service Accounts, select your account.

Note: In some instances, it may take longer for Google to generate the account automatically. In rare cases where the account is not generated, please create one by clicking on "Create Service Account".

Firebase Setup - Step 5.2

5.3. Switch to the Keys tab and click Create New Key.

Firebase Setup - Step 5.3

5.4. Choose JSON as the Key type and click Create.

Firebase Setup - Step 5.4

6. Open your Service Account key JSON file, and copy its contents into the Service Account (JSON file) field in the Modules Configuration.

Firebase Setup - Step 6

7. When you are finished, click Save on the Modules Configuration page.

Firebase Setup - Step 7


Custom CSP Configuration

If you have customized your CSP header, make sure to allow the following URLs:

"script-src" => [
    "self" => true,
    "allow" => [
        "https://www.gstatic.com/firebasejs/10.6.0-20231107192534/firebase-app.js",
        "https://www.gstatic.com/firebasejs/10.6.0-20231107192534/firebase-messaging.js"
    ]
],
 "connect-src" => [
    "self" => true,
    "allow" => [
        "https://fcm.googleapis.com/"
    ]
],

Module Information

Price:
Free
Latest version release:
2.1.3 - January 6, 2025
Website:
Compatibility:
HumHub 1.14 - 1.17