---
title: "Ionic Capacitor SDK: Push notifications"
description: "Set up push notifications for customer messages with the Gleap Ionic Capacitor SDK. Follow the integration code examples."
url: https://docs.gleap.ai/en/articles/569-ionic-capacitor-sdk-push-notifications
collection: "Ionic / Capacitor"
updated: 2026-11-01
language: en
---

# Ionic Capacitor SDK: Push notifications

Set up push notifications for customer messages with the Gleap Ionic Capacitor SDK. Follow the integration code examples.

Stay connected with your customers by utilizing push notifications to alert them of new chat messages, release notes, and news articles. This will deepen engagement and foster stronger relationships.

Gleap supports [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging) to send push notifications to users.

## Setup Firebase Cloud Messaging

To make use of Gleap Push Notifications you must add the Firebase Cloud Messaging service to your app or website. Learn how to get started with FCM [here](https://github.com/capacitor-community/fcm).

## Getting your Firebase Cloud Messaging Token

Open your project in Firebase and open the project settings.

Click on "Cloud Messaging" and, if it is not already enabled, activate the Firebase Cloud Messaging API (V1).

![Firebase Cloud Messaging API v1 settings in the existing example project.](https://staticfiles.gleap.io/p613b5dd730aed737108f87ab/EXsrhvuamORx0xa4YtpmZJLx4XMOleKSVb6TBLALNylbZ14MDv1sYjLjJyqQKq2vtu3fAsIo4uf.png)

Proceed to the "Service Accounts" section and generate a new private key, which will automatically create a file named like `serviceAccountKey.json`.

![Firebase service-account setup in the existing example project. No private key is displayed.](https://staticfiles.gleap.io/p613b5dd730aed737108f87ab/3L6WWg4TfpUDuiPLiyLesRpKNB76FF1eO4geLNXJnFQPDCnJqHFf0jyWRy7EArmsw8yjT2uITrs.png)

In Gleap, open Settings → Developer → Push notifications and upload the Firebase service-account JSON file. Keep the file private; it authorizes push delivery for the Firebase project.

![Push notification service-account file upload. No credential is shown.](https://staticfiles.gleap.io/p613b5dd730aed737108f87ab/P0ExxlppVbgauOrnK6goEgpy9DwTz5Ov3oHyxwBLNQNVfiXkOmA5Fs7cHQPhzZnopvdi2bMl7dL.png)

## Subscribe to the Gleap user topic

The last step to complete the push notification setup is to subscribe to the user topic, which Gleap will send the push notifications to. In order to do so, you will need to register the register & unregister push message topic callbacks.

```js
// Find more information here:
// https://github.com/capacitor-community/fcm
import { FCM } from "@capacitor-community/fcm";
import { PushNotifications } from "@capacitor/push-notifications";

// external required step
// register for push
await PushNotifications.requestPermissions();
await PushNotifications.register();

// Subscribe & unsubscribe to the Gleap topics
Gleap.setEventCallback((message, err) => {
  const { name, data } = message;

  if (name === "register-pushmessage-group") {
    FCM.subscribeTo({ topic: data })
      .then((r) => alert(`subscribed to topic`))
      .catch((err) => console.log(err));
  }
  if (name === "unregister-pushmessage-group") {
    FCM.unsubscribeFrom({ topic: data })
      .then((r) => alert(`unsubscribed to topic`))
      .catch((err) => console.log(err));
  }
});
```

That's it - build and run your app 🚀

## Notification images

When a changelog or news article with a featured image is sent as a push notification, Gleap includes the image in the FCM payload.

-   **Android** displays the image automatically when the notification arrives while your app is in the background — no setup required.
    
-   **iOS** requires a Notification Service Extension in your app to display the image. Follow the native setup in the [iOS push notification guide](https://gleap-developer-docs.gleap.help/en/articles/441-ios-sdk-push-notifications#notification-images) — the extension is added to the iOS project in Xcode and works unchanged in a Capacitor app.

## Related

- [Ionic Capacitor SDK setup](https://docs.gleap.ai/en/articles/563-ionic-capacitor-sdk-setup.md)
- [Ionic Capacitor SDK: User identity](https://docs.gleap.ai/en/articles/564-ionic-capacitor-sdk-user-identity.md)
- [Ionic Capacitor SDK: Frontend tools](https://docs.gleap.ai/en/articles/565-ionic-capacitor-sdk-frontend-tools.md)
- [Ionic Capacitor SDK: Track events](https://docs.gleap.ai/en/articles/566-ionic-capacitor-sdk-track-events.md)
- [Ionic Capacitor SDK: Track pages](https://docs.gleap.ai/en/articles/567-ionic-capacitor-sdk-track-pages.md)
