All Products
Search
Document Center

Mobile Platform as a Service:Huawei Push

Last Updated:Jan 21, 2026

This topic describes the three-step process for integrating Huawei Push.

  1. Register with Huawei Push

  2. Integrate Huawei Push

  3. Test Huawei Push

Register with Huawei Push

Log on to the official Huawei Developers website, create an account, and enable the push service. For more information, see Steps to enable Huawei Push.

Integrate Huawei Push

The Push SDK supports integration with Huawei Mobile Services (HMS) 2 and HMS 5. You can only integrate one of these versions.

  • HMS 2 is an older version. For new integrations, use HMS 5.

  • If you are upgrading from HMS 2 to HMS 5, you must first delete the HMS 2 AndroidManifest configuration.

Integrate Huawei Push - HMS 5.x version

  1. Add the Push - HMS5 component. The method is the same as adding the Push SDK. For more information, see Add the Push SDK.

    Note

    The Push - HMS5 component contains only adapter code and does not include the HMS SDK. You must add the HMS SDK dependency separately, as described in the following steps.

  2. In the Huawei AppGallery Connect console, download the agconnect-services.json configuration file and place it in the assets folder of your app's main project.

  3. In the build.gradle file in the project's root directory, configure the Maven repository address for the HMS SDK.

    allprojects {
     repositories {
         // Other repos are omitted.
         maven {url 'https://developer.huawei.com/repo/'}
     }
    }
  4. In the build.gradle file of the main project, add the HMS SDK dependency.

     dependencies {
         implementation 'com.huawei.hms:push:5.0.2.300'
     }
    • The HMS SDK version is updated frequently. For the latest version, see HMS SDK Version Update Notes.

    • The currently adapted version is 5.0.2.300. You can modify it as needed to use a later version. Vendor SDKs are usually backward compatible. If you encounter compatibility issues, join DingTalk group 145930007362 to request support for the new version.

  5. To use obfuscation, add the required obfuscation configurations:

Integrate Huawei Push - HMS 2.x version

  1. Add the Push - Huawei 2 component. The method is the same as adding the Push SDK. For more information, see Add the SDK. The current built-in HMS 2 SDK version is 2.5.2.201.

  2. Configure the AndroidManifest.xml file (for component-based integration, add it in the Portal project) and replace the value of com.huawei.hms.client.appid.

     <activity
          android:name="com.huawei.hms.activity.BridgeActivity"
          android:configChanges="orientation|locale|screenSize|layoutDirection|fontScale"
          android:excludeFromRecents="true"
          android:exported="false"
          android:hardwareAccelerated="true"
          android:theme="@android:style/Theme.Translucent">
           <meta-data
              android:name="hwc-theme"
              android:value="androidhwext:style/Theme.Emui.Translucent" />
     </activity>
      <!--To prevent crashes on earlier DEX versions, dynamically enable the provider. Set enabled to false.-->
      <provider
           android:name="com.huawei.hms.update.provider.UpdateProvider"
           android:authorities="${applicationId}.hms.update.provider"
           android:exported="false"
           android:enabled="false"
           android:grantUriPermissions="true">
         </provider>
             <!-- Replace "appid" in the value with the actual app ID from the service details of your application on the Huawei Developers website. Note: Keep the backslash (\) and the space in the value.-->
       <meta-data
                 android:name="com.huawei.hms.client.appid"
                 android:value="\ your huawei appId" />
         <receiver
                 android:name="com.huawei.hms.support.api.push.PushEventReceiver"
                 android:exported="true"
                 >
                 <intent-filter>
                     <!-- Receives notification messages from the channel. Compatible with earlier PUSH versions. -->
                     <action android:name="com.huawei.intent.action.PUSH" />
                 </intent-filter>
      </receiver>
    
       <receiver
                 android:name="com.alipay.pushsdk.thirdparty.huawei.HuaweiPushReceiver"
                 android:exported="true"
                 android:process=":push">
                 <intent-filter>
                     <!-- Required. Used to receive the TOKEN. -->
                     <action android:name="com.huawei.android.push.intent.REGISTRATION" />
                     <!-- Required. Used to receive messages. -->
                     <action android:name="com.huawei.android.push.intent.RECEIVE" />
                     <!-- Optional. Triggers the onEvent callback when a notification or a button in a notification is clicked. -->
                     <action android:name="com.huawei.android.push.intent.CLICK" />
                     <!-- Optional. Checks if the PUSH channel is connected. Not required if you do not need to check the connection. -->
                     <action android:name="com.huawei.intent.action.PUSH_STATE" />
                 </intent-filter>
        </receiver>
  3. To use obfuscation, add the required obfuscation configurations:

Test Huawei Push

  1. After integrating Huawei Push, start your application on a Huawei phone and ensure that the initialization method is called. For more information, see Message Push Service Initialization. The Push SDK automatically obtains and reports the Huawei Push vendor token.

  2. Send a test message after you kill the application process:

    • If you receive the message, the integration with Huawei Push is successful.

    • If you do not receive the message, follow the steps below to troubleshoot the issue.

Troubleshoot problems

  1. Verify that the Huawei configurations and parameters match those in the Huawei Push backend:

    • For HMS 2 integration, verify that the required configurations are added to AndroidManifest.xml and that the com.huawei.hms.client.appid value matches the one in the Huawei Push backend.

    • For HMS 5 integration, verify that the agconnect-services.json file exists and is in the correct location.

  2. Verify that the Huawei channel is enabled in the mPaaS console and that the configurations match those in the Huawei Push backend. For more information, see Configure the Huawei push channel.

  3. Check the logcat logs to troubleshoot issues:

    1. Select the push process and filter for mPush.PushProxyFactory. Look for the following log entry:

      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 this log is not present, there may be an issue with adding the Push - Huawei 2 or Push - HMS5 component. Verify that the component was added correctly.

    2. Select the main process and filter for mHMS. Check if the Huawei Push vendor token was obtained. If the log shows get token failed, the attempt to obtain the vendor token failed. For more information about error codes, see Huawei Push Error Codes.

    3. Select the main process and filter for report channel token. Check if the Huawei vendor token was reported successfully. If the following log appears:

      report channel token error: xxxx

      This log indicates that reporting the vendor token failed. Verify that the base64Code in the mPaaS configuration file has a value and that the APK signature that you uploaded when you obtained the configuration file matches the signature of the current application.

Other issues

Version restrictions for EMUI and Huawei Mobile Services

There are version restrictions for Emotion UI (EMUI), an operating system developed by Huawei based on Android, and for Huawei Mobile Services. For detailed version requirements, see Conditions for devices to receive Huawei push messages.

Cannot print logs on a Huawei phone

In the phone's dialer, enter *#*#2846579#*#* to open the Project Menu. Go to Background settings > LOG settings and select AP Log. You must restart the phone for the changes to take effect.