APPID and Client Secret, and then paste them into Tencent Push Notification Service console > Configuration Management > Basic Configuration > Huawei Official Push Channel.

agconnect-services.json of your Huawei application.



build.gradle file in the Android project-level directory, add the Huawei repository address and HMS Gradle plugin dependencies under repositories and dependencies in buildscript, respectively:buildscript {repositories {google()maven {url 'https://developer.huawei.com/repo/'} // Huawei Maven repository address}dependencies {// Other `classpath` configurationsclasspath 'com.huawei.agconnect:agcp:1.6.0.300' // Gradle plugin dependencies of Huawei Push}}
build.gradle file in the Android project-level directory, add the Huawei dependency repository address under repositories in allprojects:allprojects {repositories {google()maven {url 'https://developer.huawei.com/repo/'} // Huawei Maven repository address}}
agconnect-services.json obtained from the Huawei Push platform to the app module directory (not the submodule).

build.gradle file at its beginning in the app module (not the submodule build.gradle):// Other Gradle plugins of applicationapply plugin: 'com.huawei.agconnect' // HMS Push SDK Gradle pluginandroid {// Application configuration content}
build.gradle file under the app module:dependencies {// ...Other dependencies of the programimplementation 'com.tencent.tpns:huawei:[VERSION]-release' // For Huawei pushes, [VERSION] is the SDK's latest version number, which can be obtained from the release notes of SDK for Android.implementation 'com.huawei.hms:push:6.5.0.300' // HMS Core Push module dependency package}
hms:push depends on the preset <queries> tag compatible with Android 11 since v6.1.300. Upgrade Android Studio to v3.6.1 or later and the Android Gradle plugin to v3.5.4 or later. Otherwise, errors may occur during project builds.Other-Push-jar folder and import the dependent packages related to Huawei Push v5 by copying all JAR and AAR packages into the project.build.gradle file in the Android project-level directory, add HMS Gradle plugin dependencies under dependencies in buildscript:buildscript {repositories {google()jcenter()}dependencies {// Other `classpath` configurationsclasspath files('app/libs/agcp-1.4.1.300.jar') // Gradle plugin dependencies of Huawei Push}}
agconnect-services.json obtained from the Huawei Push platform to the app module directory.
build.gradle file at its beginning in the app module:// Other Gradle plugins of applicationapply plugin: 'com.huawei.agconnect' // HMS Push SDK v4 Gradle pluginandroid {// Application configuration content}
build.gradle file under the app module:dependencies {// ...Other dependencies of the programimplementation files('libs/tpns-huaweiv5-1.2.1.1.jar') // Tencent Push Notification Service plugin for HMS Coreimplementation fileTree(include: ['*.aar'], dir: 'libs') // HMS Core Push module dependent package}
<application> and </application> tags in the manifest file:<application><serviceandroid:name="com.huawei.android.hms.tpns.HWHmsMessageService"android:exported="false"><intent-filter><action android:name="com.huawei.push.action.MESSAGING_EVENT" /></intent-filter></service></application>
XGPushManager.registerPush:// Enable third-party pushXGPushConfig.enableOtherPush(getApplicationContext(), true);
V/TPush: [XGPushConfig] isUsedOtherPush:trueE/xg.vip: get otherpush errcode: errCode : 0 , errMsg : successV/TPush: [XGPushConfig] isUsedOtherPush:trueI/TPush: [OtherPushClient] handleUpdateToken other push token is : IQAAAACy0PsqAADxfCrWG3kupbOraeAiYoo9n2B-bAfb2d--kctc8E_UnY_mrIdg9ionukZvC******dVD8GlJi_5-0rpskunnNMcat35HA other push type: huawei
proguard-rules.pro file at the application project level.-ignorewarnings-keepattributes *Annotation*-keepattributes Exceptions-keepattributes InnerClasses-keepattributes Signature-keepattributes SourceFile,LineNumberTable-keep class com.hianalytics.android.**{*;}-keep class com.huawei.updatesdk.**{*;}-keep class com.huawei.hms.**{*;}-keep class com.huawei.agconnect.**{*;}
whiteList = ["R.string.hms*","R.string.connect_server_fail_prompt_toast","R.string.getting_message_fail_prompt_toast","R.string.no_available_network_prompt_toast","R.string.third_app_*","R.string.upsdk_*","R.layout.hms*","R.layout.upsdk_*","R.drawable.upsdk*","R.color.upsdk*","R.dimen.upsdk*","R.style.upsdk*","R.string.agc*"]
[OtherPushClient] handleUpdateToken other push token is : other push type: huawei
OtherPush or HMSSDK to view the return code logs, for example, [OtherPushHuaWeiImpl] other push huawei onConnect code:907135702. Then locate the error cause and rectify the error by referring to Troubleshooting Vendor Channel Registration Failures.피드백