---
updatedAt: 2026-10-09T22:02:37.000Z
---

# Enable push notifications in an Android app (Huawei)

This guide walks you through enabling push notifications in your Android app using Huawei Mobile Services (HMS) and the Acoustic Connect SDK. HMS is required to reach users on Huawei devices that do not have Google Play Services.

**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](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). If you are upgrading from SDK 10.x, see [Update the Connect Android library](https://developer.goacoustic.com/acoustic-connect/docs/update-the-connect-android-library).
* Your project meets the prerequisites for [Huawei HMS Core integration](https://developer.huawei.com/consumer/en/codelab/HMSPreparation/index.html).

<Callout icon="📘" theme="info">
  ### Note

  This guide assumes you have already set up FCM push notifications in your app. If you are not planning to use Firebase, complete the SDK push configuration and notification permission steps in [Enable push notifications in an Android app (Firebase)](https://developer.goacoustic.com/acoustic-connect/docs/enable-push-notifications-in-an-android-app-firebase) before returning here.
</Callout>

# Overview

1. **You** — set up Huawei Mobile Services in your project
2. **You** — share your HMS credentials with your Connect administrator
3. **You** — update your Gradle configuration
4. **You** — update the push configuration in the SDK initialization code
5. **Connect administrator** — adds the HMS 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 Huawei Mobile Services

1. Create an app in AppGallery Connect.
2. Enable Push Kit.
3. Generate your SHA-256 signing certificate fingerprint and register it in AppGallery Connect under **General information > SHA-256 certificate fingerprint**. To get the debug fingerprint, run:

```bash Bash
keytool -list -v \
  -keystore ~/.android/debug.keystore \
  -alias androiddebugkey \
  -storepass android \
  -keypass android
```

4. Download the configuration file (**agconnect-services.json**) from your project settings and place it in your app's `app/` directory. Re-download the file after registering the fingerprint — it must reflect the updated configuration.

# Step 2: Share HMS credentials with your Connect administrator

Copy the following values from **agconnect-services.json** and share them with your Connect administrator so they can add the HMS credentials to your **Mobile app** integration in Connect. Your app key will stay the same.

* HMS client ID
* HMS project ID
* HMS application ID
* HMS client secret

# Step 3: Update your Gradle configuration

Replace the `connect-push-fcm` entry in your dependencies with `connect-push`. This artifact bundles both FCM and HMS support and auto-detects the available provider on the device — HMS on Huawei devices, FCM on standard Android devices. You do not need to declare `:connect`, `:connect-push-fcm`, or `:connect-push-hms` separately.

If you are building exclusively for AppGallery with no Firebase dependency, use `connect-push-hms` instead.

<Tabs>
  <Tab title="Gradle">
    In **settings.gradle**, add the Huawei repository to both `pluginManagement` and `dependencyResolutionManagement`:

    ```groovy Groovy
    pluginManagement {
        repositories {
            google()
            mavenCentral()
            gradlePluginPortal()
            maven { url 'https://developer.huawei.com/repo/' }
        }
    }

    dependencyResolutionManagement {
        repositories {
            google()
            mavenCentral()
            maven { url 'https://developer.huawei.com/repo/' }
        }
    }
    ```

    In the root **build.gradle** file:

    ```groovy Groovy
    plugins {
        id 'com.android.application' version '8.4.0' apply false
        id 'org.jetbrains.kotlin.android' version '1.9.22' apply false
        id 'com.huawei.agconnect' version '1.9.1.304' apply false
    }

    buildscript {
        repositories {
            maven { url 'https://developer.huawei.com/repo/' }
        }
        dependencies {
            classpath 'com.huawei.agconnect:agcp:1.9.1.304'
        }
    }
    ```

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

    ```groovy Groovy
    plugins {
        id 'com.android.application'
        id 'org.jetbrains.kotlin.android'
        id 'com.huawei.agconnect'
    }

    dependencies {
        implementation "io.github.go-acoustic:connect-push:11.0.11"
        // For AppGallery-only builds: implementation "io.github.go-acoustic:connect-push-hms:11.0.11"
    }
    ```
  </Tab>

  <Tab title="Version catalog">
    In **gradle/libs.versions.toml**:

    ```toml TOML
    [versions]
    connect = "11.0.11"
    agcp = "1.9.1.304"

    [libraries]
    connect-push = { module = "io.github.go-acoustic:connect-push", version.ref = "connect" }
    agcp = { module = "com.huawei.agconnect:agcp", version.ref = "agcp" }

    [plugins]
    agconnect = { id = "com.huawei.agconnect", version.ref = "agcp" }
    ```

    In **settings.gradle.kts**, add the Huawei repository to both `pluginManagement` and `dependencyResolutionManagement`:

    ```kotlin Kotlin
    pluginManagement {
        resolutionStrategy {
            eachPlugin {
                if (requested.id.id == "com.huawei.agconnect") {
                    useModule("com.huawei.agconnect:agcp:${requested.version}")
                }
            }
        }
        repositories {
            google()
            mavenCentral()
            gradlePluginPortal()
            maven { url = uri("https://developer.huawei.com/repo/") }
        }
    }

    dependencyResolutionManagement {
        repositories {
            google()
            mavenCentral()
            maven { url = uri("https://developer.huawei.com/repo/") }
        }
    }
    ```

    In the root **build.gradle.kts**:

    ```kotlin Kotlin
    plugins {
        alias(libs.plugins.android.application) apply false
        alias(libs.plugins.kotlin.android) apply false
        alias(libs.plugins.google.services) apply false
        alias(libs.plugins.agconnect) apply false
    }

    buildscript {
        repositories {
            maven { url = uri("https://developer.huawei.com/repo/") }
        }
        dependencies {
            classpath(libs.agcp)
        }
    }
    ```

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

    ```kotlin Kotlin
    plugins {
        alias(libs.plugins.android.application)
        alias(libs.plugins.kotlin.android)
        alias(libs.plugins.google.services)
        id("com.huawei.agconnect")
    }

    dependencies {
        implementation(libs.connect.push)
        // For AppGallery-only builds: implementation(libs.connect.push.hms)
    }
    ```
  </Tab>
</Tabs>

For a working example, see `app/build.gradle.kts` in the sample app for your architecture:

* View-based: [app/build.gradle.kts](https://github.com/go-acoustic/Acoustic-Connect-Mobile-Push-Sample-App-Android-XML/blob/main/app/build.gradle.kts)
* Jetpack Compose: [app/build.gradle.kts](https://github.com/go-acoustic/Acoustic-Connect-Mobile-Push-Sample-App-Android/blob/main/app/build.gradle.kts)

Add `ConnectPushConfig` to your existing SDK initialization call, or update it if you already have one from the Firebase setup. Remove `strictProvider` if present so the SDK auto-detects the best available provider — HMS on Huawei devices, FCM on standard Android devices.

```kotlin View-based apps
ConnectPushConfig(
    application = this,
    iconRes = R.drawable.ic_notification,
    onTokenReady = { token -> },
    onFailure = { exception -> },
    onPermissionResult = { isGranted -> }
)
```
```kotlin Jetpack Compose apps
ConnectPushConfig(
    application = application,
    iconRes = R.drawable.ic_notification,
    onTokenReady = { token -> },
    onFailure = { exception -> },
    onPermissionResult = { isGranted -> }
)
```

The `iconRes` parameter is the same one you set up for FCM — it appears on the left side of the notification and in the status bar regardless of which push provider delivers it.

For a working example, see `MainActivity.kt` in the sample app for your architecture:

* View-based: [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)
* Jetpack Compose: [MainActivity.kt](https://github.com/go-acoustic/Acoustic-Connect-Mobile-Push-Sample-App-Android/blob/main/app/src/main/java/com/acoustic/connect/android/demo/connect/external/MainActivity.kt)

<Callout icon="📘" theme="info">
  ### Note

  On devices where both HMS and FCM are available, HMS takes priority. To force FCM on such devices, set `strictProvider = MobileServiceType.FCM` in `ConnectPushConfig`.
</Callout>

# Try the sample app

Two reference implementations are available, one for each architecture:

* View-based: [Acoustic Connect Mobile Push Sample App for Android (XML)](https://github.com/go-acoustic/Acoustic-Connect-Mobile-Push-Sample-App-Android-XML)
* Jetpack Compose: [Acoustic Connect Mobile Push Sample App for Android (Compose)](https://github.com/go-acoustic/Acoustic-Connect-Mobile-Push-Sample-App-Android)

# Troubleshooting

| Symptom                                    | Cause                                                    | Fix                                                                                                  |
| ------------------------------------------ | -------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| `907135700: get scope error`               | Push Kit not enabled in AppGallery Connect               | Enable Push Kit: **My apps** → **Develop** → **APIs enabled**                                        |
| `907135702: certificate fingerprint empty` | SHA-256 fingerprint not registered in AppGallery Connect | Add the fingerprint, then re-download **agconnect-services.json** and replace the file in `app/`     |
| Push token never arrives                   | Notification permission denied on Android 13+            | Grant `POST_NOTIFICATIONS` permission when prompted, or direct the user to app notification settings |

# Testing

Testing push notifications requires a physical Huawei device — the Android emulator does not support HMS delivery.

1. Connect a physical Huawei device to your computer via USB (or Wi-Fi) and run the app from Android Studio. The device must have an active internet connection.
2. Grant notification permission when prompted.
3. Verify that a push token is received via the `onTokenReady` callback in `ConnectPushConfig`.
4. Coordinate with your marketing team to send a test push to your device.
5. 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 Huawei Push Kit                    |
| 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  | Huawei Push Kit 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, try this:

* [Identify users at sign-in](https://developer.goacoustic.com/acoustic-connect/docs/identify-users-at-sign-in-android) — send a logged in signal after authentication so Connect can match the app visitor to a known contact.
* [Identify users at registration](https://developer.goacoustic.com/acoustic-connect/docs/identify-users-at-registration-android) — send an account registered signal after sign-up to create or match a contact from their first session.
* [Prepare for production](https://developer.goacoustic.com/acoustic-connect/docs/prepare-the-connect-library-for-production-use-on-android-devices) — configure separate HMS projects for dev and production and get your app ready to ship.