Huawei Push Kit SDK Integration

Quick Steps Guidelines

Step 1: Create A Huawei Push Message Configuration

Create and configure a project on the Huawei Developers Console.

Step 2: Integrate SDK

Add the configurations in the step to your build.gradle file.

Step 3: Initialize Netmera

Add the code to the onCreate() method of the class that extends

Step 4: Enable Pop-up Presentation

Enable pop-up notifications

Step 5: Huawei Message Receipt

For the final step, make sure to complete the steps in Huawei / Message Receipt.

Huawei SDK integration completed 👏

Step 1: Create A Huawei Push Message Configuration

Netmera utilizes Huawei Push Message to deliver push messages to Android devices. Therefore, it's essential to create and configure a project on the Huawei Developers Console. Follow these steps for Huawei Push Kit Configuration.

Huawei Push Kit Configuration Steps

  1. Begin by following Huawei's guides for setting up your application using the following links:

  2. Enable PushKit first within the Huawei panel.

  1. Add the SHA256 fingerprint value of your application to the Huawei Console.

  1. Download the agconnect-services.json file and place it in your app's folder.

  1. After completing the configuration, you will obtain the values of the App Secret Key and App_ID for your project. These values need to be added to the Netmera Dashboard under Developers > Push Backends > Huawei. Additionally, the App_ID should be used during client initialization.

The App ID and App Secret Key:

The app ID and app secret key information corresponds to the client ID and client secret key generated under the project for the app.

Step 2: Integrate SDK

The Netmera Android SDK is available through the Maven repository. To integrate it into your project, follow these steps:

Modify your build.gradle file:

Add the following configurations to your build.gradle file. AndroidManifest and other resource configurations are automatically handled by the Android Gradle build tool.

buildscript {
    repositories {
        maven {url ''
    dependencies {

    classpath ''
    classpath 'com.huawei.agconnect:agcp:'    }

  allprojects {
    repositories {
        maven {url ''}
        maven { url "" }

Add Netmera dependency:

In your build.gradle (:app) file, include the Netmera dependency within the dependencies section:

dependencies {

       implementation 'com.netmera:nmcore:3.9.11'
       implementation 'com.netmera:nmhms:3.9.5'

//must be add the bottom of app's build gradle
apply plugin: 'com.huawei.agconnect'

Important Note for Obfuscation:

If you choose to obfuscate your code, you don't need to add any specific rules. Netmera's SDK seamlessly integrates with your obfuscated code.

Step 3: Initialize Netmera

To initialize Netmera, add the following code to the onCreate() method of the class that extends If you don't have such a class, create it and add it to your AndroidManifest file using the android:name attribute within the application tag.

@Override public void onCreate() {


NetmeraConfiguration.Builder configBuilder = new NetmeraConfiguration.Builder();


//If there is an on-premise installation, you must call the following method.
//Netmera.setBaseUrl("YOUR PANEL DOMAIN URL")



    .nmInAppMessageActionCallbacks(new NGInAppMessageActionCallbacks())

    .nmPushActionCallbacks(new NGPushActionCallbacks());



Please make sure you get the API key value from the relevant panel

YOUR_SDK_API_KEY: You can get the api key from Developers > API > SDK API Key from your web panel.

Enabling Logging:

You can also enable logging by adding the following line of code to the onCreate() method of your class that extends


Step 4: Enable Pop-up Presentation

Pop-up notifications are automatically displayed within the app through an internal activity class in Netmera. However, to prevent disruption to your app's flow at launch, this feature is disabled by default. It is essential to call the following method in your main activity, ensuring not to add it to a splash activity if you have one:

To enable pop-up notifications, follow these steps:

  1. In your main activity, after it has started, add the following code:

//let Netmera to be able to show popup

Please ensure that you do not include this code in a splash activity if your app has one.

Show Netmera's push with another HMS integration

If you have your own Huawei Mobile Services (HMS) integration and wish to integrate Netmera's push notifications, consider implementing the onNetmeraPushMessageReceived method in your onMessageReceived function. Additionally, when the token is renewed, ensure to call this method to forward it to Netmera(Netmera.onNetmeraNewToken(token)

Here's an example of implementing this in your class that extends HMSMessageService:

public class PushMessaging extends HMSMessageService {

  public void onMessageReceived(RemoteMessage p0) {


    public void onNewToken(String token) {


Step 5: Huawei Message Receipt

To ensure the successful sending of push messages, please follow the steps outlined in the "Huawei Message Receipt" guide. Complete all the necessary steps as described to ensure your push messages are sent effectively.

Huawei Message Receipt:

Make sure to complete the steps in Huawei / Message Receipt to send push messages.

Huawei Push Kit SDK integration completed 👍

Huawei SDK integration has been successfully completed, and your devices are now ready to receive the following types of push notifications sent via the Netmera Dashboard:

  1. Standard Push Notifications

  2. Interactive Push Notifications (If you've configured and published them using the Dashboard)

  3. Push Notifications with Web View Content

  4. Push Notifications with Deeplinks (If your application supports URL Scheme-based deeplinks and you've configured the application's URL Scheme in the Dashboard.)

Last updated