公告
产品功能动态
Android SDK 发布动态
iOS SDK 发布动态
macOS SDK 发布动态



buildscript {repositories {google()maven {url 'https://developer.huawei.com/repo/'} // 华为 maven 仓库地址}dependencies {// 其他classpath配置classpath 'com.huawei.agconnect:agcp:1.6.0.300' // 华为推送 gradle 插件依赖}}
allprojects {repositories {google()maven {url 'https://developer.huawei.com/repo/'} // 华为 maven 仓库地址}}

// app 其他 gradle 插件apply plugin: 'com.huawei.agconnect' // HMS SDK gradle 插件android {// app 配置内容}
dependencies {// ... 程序其他依赖implementation 'com.tencent.tpns:huawei:[VERSION]-release' // 华为推送 [VERSION] 为当前最新 SDK 版本号,版本号可在 Android SDK 发布动态 查看implementation 'com.huawei.hms:push:6.5.0.300' // HMS Core Push 模块依赖包}
<queries> 标签,请注意升级 Android Studio 至3.6.1或更高版本、Android Gradle 插件至 3.5.4或更高版本,否则可能导致工程构建出错。buildscript {repositories {google()jcenter()}dependencies {// 其他 classpath 配置classpath files('app/libs/agcp-1.4.1.300.jar') // 华为推送 gradle 插件依赖}}

// app 其他 gradle 插件apply plugin: 'com.huawei.agconnect' // HMS SDK V4 gradle 插件android {// app 配置内容}
dependencies {// ... 程序其他依赖implementation files('libs/tpns-huaweiv5-1.2.1.1.jar') // 适用于 HMS Core 版本的 移动推送 插件implementation fileTree(include: ['*.aar'], dir: 'libs') // HMS Core Push 模块依赖包}
<application> </application> 标签内添加以下组件:<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 前,开启第三方推送接口://打开第三方推送XGPushConfig.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
-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
[OtherPushHuaWeiImpl] other push huawei onConnect code:907135702),并前往 厂商通道注册失败排查指南 查找对应原因,获取解决办法。文档反馈