---
title: "Set up push notifications"
description: "Connect Firebase Cloud Messaging so your users get a push when your team replies, and so you can send push campaigns to your web and mobile apps."
url: https://help.gleap.ai/fr/articles/16751983-set-up-push-notifications
collection: "Developer guides"
updated: 2026-11-16
language: fr
alternates: [en]
---

# Set up push notifications

Connect Firebase Cloud Messaging so your users get a push when your team replies, and so you can send push campaigns to your web and mobile apps.

Push notifications reach your users when your app isn't open. Once they're set up, Gleap sends a push whenever your team or Kai replies in a messenger conversation, and you can send push campaigns from Outreach. Gleap delivers every push through Firebase Cloud Messaging (FCM), for web, iOS and Android alike. Setting it up needs a developer and a Firebase project. Only project admins see the settings page.

### How it works

Gleap never asks for your users' device tokens. Instead, the SDK tells your app which Firebase topic belongs to the logged-in user, your app subscribes the device to that topic, and Gleap sends to the topic. When the user logs out, the SDK tells your app to unsubscribe.

### Connect Firebase

1.  In the Firebase console, open your project and make sure the **Firebase Cloud Messaging API (V1)** is enabled.
    
2.  Under **Service accounts** in your Firebase project settings, generate a new private key. Firebase downloads a JSON file, usually named `serviceAccountKey.json`.
    
3.  In Gleap, go to **Settings → Developer → Push notifications**.
    
4.  Under **Firebase Cloud Messaging**, the **Service account key** row shows **Not set**. Click **Upload** next to it, or drop the file onto the **Upload file** area below.
    

![Push notifications screen in the Pied Piper demo project.](https://staticfiles.gleap.io/p613b5dd730aed737108f87ab/GGdGFU0pOWqdg9VOl4D5MzY1GlsGvdC5l2DW4QfnvUj96R2JCAcqKw8Ez9CiHKROY0jQ0odD0Xd.png)

The **Service account key** row now shows **Configured**. There's nothing else to save. Use **Replace** to upload a new key, or **Remove** to stop sending pushes.

> **Info:** There's no separate field for Apple keys. iOS pushes go through Firebase too, so add your APNs key to the Firebase project instead.

### Subscribe devices in your app

This part happens in your code, and the steps differ per platform:

-   **Web**: listen for the SDK's `register-pushmessage-group` and `unregister-pushmessage-group` events and subscribe the browser's FCM token to the topic from your server.
    
-   **iOS**: implement `registerPushMessageGroup` and `unregisterPushMessageGroup` in your Gleap delegate. Pass taps on a Gleap push to `handlePushNotification` so the conversation opens. Images need a Notification Service Extension.
    
-   **Android**: set the register callback with `setRegisterPushMessageGroupCallback` and pass taps to `handlePushNotification`.
    
-   **Flutter, React Native and Capacitor**: follow the guide for your SDK.
    

The developer documentation has a step-by-step guide with code for each SDK, under **Push notifications** in the section for your platform.

```javascript
Gleap.on("register-pushmessage-group", (topic) => {
  // Subscribe this browser's FCM token to the topic on your server.
});

Gleap.on("unregister-pushmessage-group", (topic) => {
  // Unsubscribe it again.
});
```

### What sends a push

-   **A reply in a messenger conversation.** Every message your team or Kai sends in a widget conversation triggers a push titled "New comment from" and the sender's name, with the start of the message.
    
-   **A push campaign.** Go to **Outreach → Push notifications** and click **Create push notification**.
    
-   **A chat message or news item** with its **Push notification** switch on.
    

Push campaigns are part of Outreach, available on Growth and up (Team on older plans). Reply notifications don't need Outreach: they start as soon as Firebase is connected.

> **Warning:** Pushes only arrive on devices your app subscribed to the user's topic. If a user gets nothing, check that your app handles the register event after `identify` and after every login.

### Related

-   [Send emails, chat messages, push and WhatsApp](https://help.gleap.ai/en/articles/325-send-emails-chat-messages-push-and-whatsapp.md)
    
-   [Find the developer docs](https://help.gleap.ai/en/articles/362-find-the-developer-docs.md)
    
-   [Identify users and send attributes and events](https://help.gleap.ai/en/articles/230-identify-users-and-send-attributes-and-events.md)
    
-   [Use Gleap on your phone](https://help.gleap.ai/en/articles/231-use-gleap-on-your-phone.md)
