---
updatedAt: 2026-10-09T22:01:39.000Z
---

# Enable push notifications in an Android app (Firebase)

This guide walks you through enabling push notifications in your Android app using Firebase Cloud Messaging (FCM) and the Connect SDK.

The Connect SDK supports the following push notification features. Each is authored by your marketing team in **Message composer**:

* **Thumbnail images** in the collapsed notification, useful for branding such as a logo.
* **Expandable content** shown when the user expands the notification - either additional text or a full image.
* **Actionable notifications**, with a built-in action that fires when the user taps - open the app, call a number or open a URL.

The notification icon that appears in the status bar and next to the notification is configured in your app code, not in Message composer. See [Step 4](#step-4-add-push-configuration-to-the-sdk) for requirements.

**Languages**: Kotlin and Java

**Availability**: Pro, Premium and Ultimate

**Scope**: This guide covers setting up push notifications for development and testing. For production configuration, see [Prepare the Connect library for production use on Android devices](https://developer.goacoustic.com/acoustic-connect/docs/prepare-the-connect-library-for-production-use-on-android-devices).

# Prerequisites

* **Connect SDK 11.0.11 or later**, integrated into your app. See the integration guide for your architecture: [View-based](https://developer.goacoustic.com/acoustic-connect/docs/integrate-the-connect-library-into-a-view-based-android-app) or [Jetpack Compose](https://developer.goacoustic.com/acoustic-connect/docs/integrate-connect-sdk-into-android-compose-app).
* **An app key that supports push notifications.** If your Android project is using an app key from a legacy **Web and mobile** integration created before April 2026, ask your Connect administrator to create a new **Mobile app** integration and replace the app key in your project. See [Connect mobile apps](https://connect.goacoustic.com/hc/en-us/articles/50316996762387-Connect-mobile-apps) in the user guide.
* Your project meets the [Firebase prerequisites for Android](https://firebase.google.com/docs/android/setup#prerequisites).

# Overview

1. **You** - set up Firebase Cloud Messaging in your project
2. **You** - share your FCM credentials with your Connect administrator
3. **You** - update your Gradle configuration
4. **You** - add push configuration to the SDK initialization code
5. **Connect administrator** - uploads your FCM credentials to your **Mobile app** integration in Connect

Steps 3–4 can be completed while waiting for your Connect administrator to complete Step 5. Push notifications will not be delivered until Step 5 is done.

# Step 1: Set up Firebase Cloud Messaging

Set up Firebase in your project following the [Firebase guide](https://firebase.google.com/docs/android/setup). All steps are required, with the following considerations:

* If your project uses `applicationIdSuffix` for debug builds, register the debug package name as a separate app in your Firebase project before downloading `google-services.json`.

<Image src="https://files.readme.io/0632833969e32e86872371064834035760801ea9e965fbe8357fa78cb751c525-package-name.png" alt="Package name in Firebase Console" align="left" width="500px" border={true} wrap={true} />

<br />

* Google Analytics is optional and unrelated to push notifications.
* We recommend using the [Firebase Android BoM](https://firebase.google.com/docs/android/learn-more#bom) to control library versioning.

Once you have completed the Firebase guide, generate a service account key: in the Firebase console, go to **Settings > Service accounts** and click **Generate new private key**. Connect uses this file to authenticate with FCM on your behalf when sending push notifications. For more information, see [Initialize the SDK in non-Google environments](https://firebase.google.com/docs/admin/setup#initialize_the_sdk_in_non-google_environments).

# Step 2: Share FCM credentials with your Connect administrator

Share the service account key with your Connect administrator - they'll upload it to your **Mobile app** integration in Connect. Your app key will stay the same.

# Step 3: Update your Gradle configuration

Replace the `connect` dependency with `connect-push-fcm`. `connect-push-fcm` extends the core SDK with push notification support and includes `firebase-messaging` automatically.

<Tabs>
  <Tab title="Gradle">
    In the app-level **build.gradle.kts**:

    ```kotlin Kotlin
    dependencies {
        implementation("io.github.go-acoustic:connect-push-fcm:11.0.13")

        implementation(platform("com.google.firebase:firebase-bom:34.14.0"))
    }
    ```
  </Tab>

  <Tab title="Version catalog">
    In **gradle/libs.versions.toml**, update the library entry:

    ```toml TOML
    [versions]
    connect = "11.0.13"

    [libraries]
    connect-push-fcm = { module = "io.github.go-acoustic:connect-push-fcm", version.ref = "connect" }
    ```

    In the app-level **build.gradle.kts**:

    ```kotlin Kotlin
    dependencies {
        implementation(libs.connect.push.fcm)

        implementation(platform("com.google.firebase:firebase-bom:34.14.0"))
    }
    ```
  </Tab>
</Tabs>

Sync the project after making this change.

For a reference implementation, see [app/build.gradle.kts](https://github.com/go-acoustic/Acoustic-Connect-Mobile-Push-Sample-App-Android-XML/blob/main/app/build.gradle.kts) in our sample project.

# Step 4: Add push configuration to the SDK

Add a `ConnectPushConfig` to your existing SDK initialization call.

```kotlin View-based apps
class MyApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        Connect.init(this)
        Connect.enable(
            appKey = "YOUR_APP_KEY",
            postMessageUrl = "YOUR_COLLECTOR_URL",
            pushConfig = ConnectPushConfig(
                application = this,
                iconRes = R.drawable.ic_notification,
                onTokenReady = { token -> },
                onFailure = { exception -> },
                onPermissionResult = { isGranted -> }
            )
        )
    }
}
```
```kotlin Jetpack Compose apps
ConnectWrapper(
    navController = navController,
    appKey = "YOUR_APP_KEY",
    postMessageURL = "YOUR_COLLECTOR_URL",
    pushConfig = ConnectPushConfig(
        application = application,
        iconRes = R.drawable.ic_notification,
        onTokenReady = { token -> },
        onFailure = { exception -> },
        onPermissionResult = { isGranted -> }
    )
) {
    // Your app content
}
```

For a reference implementation, see [MainActivity.kt](https://github.com/go-acoustic/Acoustic-Connect-Mobile-Push-Sample-App-Android-XML/blob/main/app/src/main/java/com/acoustic/connect/android/demo/connect/external/MainActivity.kt) in the sample project.

## Notification icon

Replace `R.drawable.ic_notification` with a drawable resource from your app. This icon appears on the left side of the notification and in the status bar. It must be entirely white on a transparent background (24×24 dp) with no `android:tint` attribute - if a colored icon is used, Android will display a white square instead. You can generate a compliant icon using [Android Asset Studio](https://romannurik.github.io/AndroidAssetStudio/icons-notification.html).

For a reference implementation, see [ic\_notification.xml](https://github.com/go-acoustic/Acoustic-Connect-Mobile-Push-Sample-App-Android-XML/blob/main/app/src/main/res/drawable/ic_notification.xml) in the sample project.

## Notification permission

On Android 13 and above, `ConnectPushConfig` automatically requests the `POST_NOTIFICATIONS` runtime permission when the app launches. Use the `onPermissionResult` callback to react to the user's response - for example, to update UI or show a rationale if the user denies. No manual `registerForActivityResult` call is needed.

The permission declaration is included in the SDK's manifest and merged automatically - you do not need to add it to your app's **AndroidManifest.xml** unless you want to restrict it to Android 13 and above using `android:minSdkVersion="33"`.

To check the current permission state without prompting the user:

```kotlin Kotlin
val isPushEnabled = Connect.push.isPushAccepted(context)
```

## Verify the setup

Before proceeding, confirm that your Connect administrator has completed Step 5 - no FCM token will be received until the service account key is uploaded to Connect.

Run the app on a physical device with Google Play Services and an active internet connection - the Android emulator does not support FCM delivery - and open Logcat in Android Studio. Filter by tag `ConnectPush` and look for the following entry:

```
ConnectPush   co.heron.app.debug   D  Create token registration event ...
```

This confirms the SDK received an FCM token and queued a push registration event.

Once verified, proceed to [Testing](#testing) to send a test push with your marketing team.

# Troubleshooting

The following errors may appear in Logcat during setup.

| Symptom                                                          | Cause                                                         | Fix                                                                                                                                             |
| ---------------------------------------------------------------- | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `Failed to resolve: com.google.firebase:firebase-messaging:null` | `google-services.json` missing from the `app/` directory      | Download the file from Firebase Console → Project settings → Your apps and place it in `app/`                                                   |
| Push token never arrives                                         | Notification permission denied on Android 13+                 | Grant `POST_NOTIFICATIONS` permission when prompted                                                                                             |
| `AUTHENTICATION_FAILED`                                          | Service account key uploaded to Connect is expired or invalid | Generate a new private key in Firebase Console (**Settings > Service accounts**) and re-upload it to your **Mobile app** integration in Connect |

# Testing

Testing push notifications requires a physical device. Before sending a test push, we recommend enabling identification signals in your app - without them, the device will appear as an anonymous contact in Connect. This reproduces a real-life scenario where you can send pushes to known contacts and verify responses in their activity feed:

* [Identify users at sign-in](https://developer.goacoustic.com/acoustic-connect/docs/identify-users-at-sign-in-android)
* [Identify users at registration](https://developer.goacoustic.com/acoustic-connect/docs/identify-users-at-registration-android)

Once identification is in place, follow these steps to send a test push:

1. Run the app and log in or register to trigger an identification signal.
2. Grant notification permission when prompted.
3. Coordinate with your marketing team to send a test push to your device or do it yourself (see [Test your push notification setup](https://developer.goacoustic.com/acoustic-connect/docs/test-push-notification-setup)).
4. Verify the notification appears, images load and push signals appear in the contact's activity feed in Connect.

## Push signals in Connect

Once push is set up, Connect records signals for each notification automatically. You don't need to write any code to send them.

| Signal               | Recorded when                                                        |
| -------------------- | -------------------------------------------------------------------- |
| Mobile push send     | Connect sends the notification to Firebase Cloud Messaging           |
| Mobile push delivery | The notification arrives on the device                               |
| Mobile push open     | The user taps a notification that opens your app or the phone dialer |
| Mobile push failure  | Firebase Cloud Messaging rejects the notification                    |

Send and failure are recorded as soon as Connect sends the notification. Delivery and open come from the push integration on this page, so they appear only after it's set up. You can see all four signals in the contact's activity feed. To use them in segments, see [Segment by customer actions](https://connect.goacoustic.com/hc/en-us/articles/48670736337427-Segment-by-customer-actions).

# Next steps

Push setup is now complete. To make the most of push notifications:

* [Enable push notifications (Huawei)](https://developer.goacoustic.com/acoustic-connect/docs/enable-push-notifications-in-android-app-huawei) - add HMS support if your app targets users on Huawei devices or markets in China, where Google Play Services is unavailable.
* [Prepare for production](https://developer.goacoustic.com/acoustic-connect/docs/prepare-the-connect-library-for-production-use-on-android-devices) - configure your Firebase and Connect setup for production, enable ProGuard rules and get your app ready to ship.