
Google Firebase is used for notifications in mobile apps and websites.


<div class="admonition admonition-important"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

From May 15, 2024, tokens which are inactive for 270 days become expired. More information is available in [Google Firebase documentation](https://firebase.google.com/docs/cloud-messaging/manage-tokens#stale-and-expired-tokens).

</div></div></div>


## Requirements
---
- Create a Firebase project.
- Enable [FCM Registration API](https://console.cloud.google.com/apis/library/fcmregistrations.googleapis.com?) for your project.
- If you want to use push encryption, you must implement decryption in your mobile applications. Client apps without decryption implemented will not receive push messages at all. See the following articles:  
    - [iOS SDK](/developers/mobile-sdk/configuring-push-notifications/ios#configure-notification-encryption)
    - [Android SDK](/developers/mobile-sdk/configuring-push-notifications/android#configure-notification-encryption)
    - [React Native SDK](/developers/mobile-sdk/configuring-push-notifications/react-native#configure-notification-encryption)

## Collecting integration parameters from Firebase
---
1. Go to Firebase Console website.
3. Go to **Project Settings**.  
    **Result**: You are redirected to the **General** tab.
4. Copy the value of **Project ID** and save it in a text editor.
5. If you want to use web push:
    1. On the **General** tab, scroll down to the **Your apps** section.
    5. If you don't have a Web app, create one:
        1. Click **Add app** and then **</>**
        2. Enter a name for your app.
        3. Leave **Also set up Firebase Hosting for this app** unselected (default).  
            Synerise doesn't require Firebase Hosting. You can enable it if your other integrations require that.
        4. Click **Register App** and wait until the app is registered.  
            **Result**: The app is created. You don't need to integrate the displayed SDK code. Synerise handles the integration after you configure the integration, as described in the next steps.
        5. Click **Continue to console**.
    6. Click the Web app.
    7. From the code snippet shown in **SDK set up and configuration**, copy the following values into a text editor:
        - `apiKey`
        - `appId` 
            <figure><img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/settings/tool/_gfx/firebase-values.png" class="large" alt="The values to copy"><figcaption>The values to copy</figcaption></figure>
5. Go to the **Cloud Messaging** tab.
    1. Copy the value of **Sender ID** and save it in a text editor.
2. Go to the **Service accounts** tab.
    1. Click **Generate new private key**.
    3. Confirm with **Generate key** and wait a few seconds.
    4. Save the key.  
        Depending on your browser and settings, the key may open in a window or be saved as a JSON file.  
        Save the entire contents (all properties).
10. Proceed to [Enabling Firebase in Synerise](/docs/settings/tool/firebase#enabling-firebase-in-synerise).


## Enabling Firebase in Synerise
---
1. [Collect integration parameters from Firebase](Collecting integration parameters from Firebase).
1. Go to <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/settings-icon.svg" alt="Settings icon" class="icon">**Settings > Apps & Services**.
2. In the list of integrations, next to **Firebase**, click **Show**.  
    **Result**: A list of existing Firebase connections opens.
3. Click **Add connection**.
4. Under **Connection with Firebase**, switch the toggle on.  
5. In the **Connection name** field, enter the name of the connection.  
    It will be available only on the list of Firebase connections in Synerise. 
4. Select the channel for which you are enabling integration:  


   <div class="content-tabs" data-tab-group="tabgrp-1313">
   <div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1313-0" data-tab-group="tabgrp-1313" data-tab-active="true">Mobile</button><button class="tab-button" data-tab-id="tabgrp-1313-1" data-tab-group="tabgrp-1313">Web</button></div>

   <div class="tab-panel" data-tab-id="tabgrp-1313-0" data-tab-group="tabgrp-1313" data-tab-active="true">

   2. Fill in the following fields, using the data you retrieved in [Collecting integration parameters from Firebase](#collecting-integration-parameters-from-firebase):
       - **Sender ID**  
       This field is required.
       - **Project ID**  
       This is required to send notifications. If you haven’t copied it earlier in the process, you can find it in your Firebase Console project settings on the  **General** tab.
       - **Private key**  
       Private key is required to create authentication tokens. In this field , you must paste **the entire JSON file** you downloaded when [Collecting integration parameters from Firebase](#collecting-integration-parameters-from-firebase).
   1. Click **Apply**.

   </div>

   <div class="tab-panel" data-tab-id="tabgrp-1313-1" data-tab-group="tabgrp-1313">

   2. Fill in the following fields, using the data you retrieved in [Collecting integration parameters from Firebase](#collecting-integration-parameters-from-firebase):
       - **Sender ID**  
       Filling out this field is required to implement web push mechanism into your website.
       - **Project ID**  
       This is required to send notifications. If you haven’t copied it earlier in the process, you can find it in your Firebase Console project settings on the  **General** tab.
       - **App ID**  
       If you haven’t copied it earlier in the process, you can find it in your Firebase Console project settings on the  **General** tab.
       - **Web API key**
       If you haven't copied it earlier in the process, you can find it in your Firebase Console project settings on the  **General** tab.  
       - **Private key**  
       Private key is required to create authentication tokens. In this field , you must paste **the entire JSON file** you downloaded when [Collecting integration parameters from Firebase](#collecting-integration-parameters-from-firebase).

   1. Click **Apply**.

   </div>
   </div>


## Enabling push encryption


<div class="admonition admonition-warning"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z" /></svg></div><div class="admonition-body"><div class="admonition-content">

- When you enable encryption, web push agreements of all Profiles are changed to `false`. You must collect new web push agreements.
- When push encryption is enabled, it becomes active both for web push and mobile push. You must enable [decryption is in your mobile application](/developers/mobile-sdk/configuring-push-notifications).

</div></div></div>


1. **Web push only**:
    1. In Firebase Console, open the project settings.
    5. Go to the **Cloud Messaging** tab.
    3. Retrieve the encryption keys:
        1. Scroll down to **Web configuration**.
        4. In **Web Push certificates**, create or retrieve a key pair.  
            To access the private key, you may need the Owner role in the Firebase project.
            <figure><img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/settings/tool/_gfx/firebase-cloud-messaging.png" class="large" alt="Cloud Messaging section"><figcaption>Cloud Messaging section</figcaption></figure>
        5. Save the key pair in a text editor.  
            
   <div class="admonition admonition-tip"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   In Synerise, these keys are called **VAPID keys**.

   </div></div></div>

1. In Synerise, go to <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/settings-icon.svg" alt="Settings icon" class="icon">**Settings > Apps & Services**.
2. In the list of integrations, next to **Firebase**, click **Show**.  
    **Result**: A list of existing Firebase connections opens.
3. On the connection you want to update, click **<img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/threedoticon.png" alt="Three dots icon" class="icon"> > Edit**.
3. Perform the following actions:
    
   <div class="admonition admonition-warning"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   The setting applies both to mobile and web push. You must [implement mobile push decryption](/developers/mobile-sdk/configuring-push-notifications)!

   </div></div></div>


    1. Switch on the **Push encryption** toggle.  
    2. **Web push only**: Fill in the following fields:  
        
   <div class="admonition admonition-warning"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   If you do not provide the keys, web push messages won't be sent at all.

   </div></div></div>

        1. **Public VAPID key**  
        If you haven’t copied it earlier in the process, you can find it in your Firebase account settings, on the **Cloud Messaging** tab, under **Web push certificates**. To access the private key, you may need the Owner role in the Firebase project.
        2. **Private VAPID key**  
        If you haven’t copied it earlier in the process, you can find it in your Firebase account settings, on the **Cloud Messaging** tab, under **Web push certificates**. To access the private key, you may need the Owner role in the Firebase project.
4. Click **Apply**.