All Products
Document Center

Integrate HUAWEI Push

Last Updated: Jun 21, 2022

This guide mainly introduces the process of integrating HUAWEI Push. The process falls into three steps:

  1. Register HUAWEI Push

  2. Integrate HUAWEI Push

  3. Test HUAWEI Push

Register HUAWEI Push

Visit the Huawei Developer official website, register an account, and enable the push service. For more information, see Enable HUAWEI Push.

Integrate HUAWEI Push

MPS supports access to Huawei HMS2 and HMS5. However, you can only select HMS2 or HMS5 in the process of integrating Huawei push component.

  • The HMS2 is obsolete. If you are integrating HUAWEI Push for the first time, you are recommended to integrate HMS5.

  • If you have upgraded from HMS2 to HMS5, you need to delete the HMS2 AndroidManifest configuration listed below first.

The following describes the integration methods of Huawei HMS2 and HMS5 respectively.

HUAWEI Push - HMS5.x version

  1. Add Push - HMS5 component in the IDE plugin. The steps are roughly the same as adding MPS SDK, see Add SDK.


    The Push - HMS5 component only contains adaptive codes, without HMS SDK. You can add the HMS SDK dependencies separately by following the steps below.

  2. Download the configuration file agconnect-services.json in the Huawei App Service Console and place it under the assets directory of the main project.

  3. Configure the Maven warehouse address of HMS SDK in the build.gradle file in the project root directory.

     allprojects {
         repositories {
             // Other repos are ignored
             maven {url ''}
  4. Add HMS SDK dependencies in the build.gradle file of the main project.

     dependencies {
         implementation 'com.huawei.hms:push:'
    • The HMS SDK version is updated frequently. For the latest version, refer to HMS SDK Version Change History.

    • The current adaptable version is If you need to use a higher version, you can change it by yourself. Generally, the vendor’s SDK is downward compatible. If it is not compatible, you can submit a ticket about the adaption issue.

  5. To use obfuscation, you need to add the related obfuscation configurations.

HUAWEI Push - HMS2.x version

  1. Add Push - HMS2 component in the IDE plugin. The steps are roughly the same as adding MPS SDK, see Add SDK.

    The current HMS2 SDK version is V2.5.2.201.

  2. Configure AndroidManifest.xml, and replace the value of com.huawei.hms.client.appid. If you integrate the MiPush SDK through Portal & Bundle projects, please configure the AndroidManifest.xml in the Portal project.

              android:value="androidhwext:style/Theme.Emui.Translucent" />
      <!--To prevent dex crashing in an earlier version, dynamically enable provider, and set "enabled" to false.-->
             <!-- Replace the "appid" of value with the actual app ID in the service details of the app on Huawei Developer. Keep the slash (\) and space in the value. -->
                 android:value="\ your huawei appId" />
                     <!-- Receive the notification bar message sent by the channel. It is compatible with earlier versions of PUSH.-->
                     <action android:name="com.huawei.intent.action.PUSH" />
                     <!-- Required, used for receiving TOKEN. -->
                     <action android:name="" />
                     <!-- Required, used for receiving messages -->
                     <action android:name="" />
                     <!-- Optional, used for triggering onEvent callback upon a click on the notification bar or the button on the notification bar -->
                     <action android:name="" />
                     <!-- Optional, used for checking whether the PUSH channel is connected. You do not need to configure this parameter if access check is not required -->
                     <action android:name="com.huawei.intent.action.PUSH_STATE" />
  3. To use obfuscation, you need to add the related obfuscation configurations.

    • If you integrated HUAWEI push SDK through Native AAR, you need to add mPaaS obfuscation rules.

    • If you integrated HUAWEI push SDK through other methods, you don’t have to add any obfuscation configuration.

Test HUAWEI Push

  1. After integrating HUAWEI Push, you can start the app on your Huawei phone, and the MPS SDK will automatically get the HUAWEI Push token and report it. Before you start the app, make sure that you have called the initialization method, see Message push initialization.

  2. Push test messages when the app process is killed:

    • If you can still receive the messages, it means that the app has successfully integrated HUAWEI Push.

    • If you cannot receive the messages, you can follow the steps below for troubleshooting.


  1. Check if the Huawei configuration and parameters are consistent with that in the Huawei push backend.

    • For HMS2, check if AndroidManifest.xml has related configurations added, and check if com.huawei.hms.client.appid is same as that in Huawei push backend.

    • For HMS5, check if agconnect-services.json exists, and the file is correctly placed.

  2. Check if HUAWEI Push is enabled in the mPaaS console (see Configure HUAWEI Push), and the relevant configurations are consistent with that on Huawei push backend.

  3. View the logs in Logcat to troubleshoot:

    1. Select the push process, filter mPush.PushProxyFactory, and check if the following log exists:

      D/mPush.PushProxyFactory: found proxy com.mpaas.push.external.hms.Creator (HMS2)
      D/mPush.PushProxyFactory: found proxy com.mpaas.push.external.hms5.Creator (HMS5)

      If not, it means that there may be a problem with the Push - HMS2 or Push - HMS5 component. Check if the component has been correctly added.

    2. Select the main process, filter mHMS, and check if the channel token of HUAWEI Push has been obtained. If the following log (get token failed) appears:


      It means the system failed to get the channel token, see HUAWEI Push Result Codes for the failure reason.

    3. Select the main process, filter report channel token, check if the channel token of HUAWEI Push has been successfully reported. If the following log appears:

      report channel token error: xxxx

      It means the channel token reporting failed, you need to check if the base64Code in the mPaaS configuration file has a value, and check if the apk signature that you uploaded when obtaining the configuration file is consistent with the app.

  4. If the above steps do not resolve the issue, please search for the group number 31591197 with DingTalk to join DingTalk group for further communication.

Other questions

Does MPS has any version restrictions on EMUI and Huawei mobile services

There are version restrictions on Emotion UI (EMUI for short, it is an Android-based emotional operating system developed by Huawei) and Huawei mobile services.

For detailed version requirements, see Conditions for devices to receive Huawei notifications.

Failed to print logs for Huawei mobile phones

On the dialing interface of the Huawei mobile phone, enter ##2846579## to enter Project menu > Background settings > LOG settings and select AP Logs. After the phone restarts, Logcat will start to take effect.