AppId, Client ID, and Client Secret and paste them into the AppId, ClientId, and SecretKey fields in Tencent Push Notification Service console > Configuration Management > Basic Configuration > HONOR Official Push Channel.build.gradle file in the Application module and then add the following nodes:AppID. The sample code is as follows:manifestPlaceholders = [HONOR_APPID : "xxxx"]
implementation 'com.tencent.tpns:honor:[VERSION]-release'
<queries> tag on Android 11. Upgrade Android Studio to v3.6.1 or later, and upgrade the Android Gradle plugin to v3.5.4 or later; otherwise, an error may occur when you build the project.Other-Push-jar folder and import the HONOR Push-related jar package.Androidmanifest.xml file:<application><receiverandroid:name="com.hihonor.push.sdk.PushReceiver"android:exported="true"android:permission="${applicationId}.hihonor.permission.PROCESS_PUSH_MSG"><intent-filter><action android:name="com.hihonor.push.action.REGISTRATION" /><action android:name="com.hihonor.push.action.RECEIVE" /></intent-filter></receiver><providerandroid:name="com.hihonor.push.sdk.init.AutoInitProvider"android:authorities="${applicationId}.hihonor.autoinitprovider"android:exported="false"android:initOrder="500" /><!-- Custom HONOR push callback service --><serviceandroid:name="com.tencent.android.tpush.honor.HonorMessageService"android:exported="false"><intent-filter><action android:name="com.hihonor.push.action.MESSAGING_EVENT" /></intent-filter></service><meta-dataandroid:name="com.hihonor.push.sdk_version"android:value="6.0.3.102" /><!-- HONOR Push appId --><meta-dataandroid:name="com.hihonor.push.app_id"android:value="HONOR Push AppId"</application><permissionandroid:name="${applicationId}.hihonor.permission.PROCESS_PUSH_MSG"android:protectionLevel="signatureOrSystem" /><uses-permission android:name="com.hihonor.push.permission.READ_PUSH_NOTIFICATION_INFO" /><queries><intent><action android:name="com.hihonor.push.action.BIND_PUSH_SERVICE" /></intent></queries>
XGPushManager.registerPush:// Enable third-party pushXGPushConfig.enableOtherPush(getApplicationContext(), true);// The log of successful registration is as follows:I/TPush: [OtherPushClient] handleUpdateToken other push token is : IQAAAACy0Ps******GlJi_5-0rpskunnNMcat35HA other push type: honorI/TPush: [PushServiceBroadcastHandler] >> bind OtherPushToken success ack with [accId = 150000**** , rsp = 0] token = 01a22******ed343 otherPushType = honor otherPushToken = IQAAAACy0Ps******GlJi_5-0rpskunnNMcat35HA
-ignorewarnings-keepattributes *Annotation*-keepattributes Exceptions-keepattributes InnerClasses-keepattributes Signature-keepattributes SourceFile,LineNumberTable-keep class com.hihonor.push.framework.aidl.**{*;}-keep class com.hihonor.push.sdk.**{*;}
proguard-rules.pro file at the application project level.[OtherPushClient] handleUpdateToken other push token is : other push type: honor
OtherPush to view the return code logs. Then, locate the error cause and fix the error by referring to Troubleshooting Vendor Channel Registration Failures.Feedback