From 2c044d0ee4082a759dda1a2406aa62280d404bf7 Mon Sep 17 00:00:00 2001 From: chenjuntao Date: Thu, 9 May 2024 11:14:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=81=A2=E5=A4=8D=E6=9E=81=E5=85=89?= =?UTF-8?q?=E6=8E=A8=E9=80=81=EF=BC=8C=E7=A7=BB=E9=99=A4=E6=9E=81=E5=85=89?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=88=9D=E5=A7=8B=E5=8C=96=20https://jira.sh?= =?UTF-8?q?anqu.cc/browse/GHZSCY-5342?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chenjuntao --- app/build.gradle | 14 +++++++------- .../java/com/gh/gamecenter/jg/push/JPushHelper.kt | 4 ++++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 97c481893b..f815f6f8bf 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -409,13 +409,13 @@ dependencies { } internalImplementation(project(':module_internal_test')) -// def pushProperty = findProperty('BUILD_PUSH_TYPE') -// // 根据BUILD_PUSH_TYPE决定使用哪个推送SDK,目前默认使用极光推送 -// def pushProject = (pushProperty == null || pushProperty == 'jg') -// ? project(':feature:jg_push') : project(':feature:acloud_push') -// implementation(pushProject) { -// exclude group: 'androidx.swiperefreshlayout' -// } + def pushProperty = findProperty('BUILD_PUSH_TYPE') + // 根据BUILD_PUSH_TYPE决定使用哪个推送SDK,目前默认使用极光推送 + def pushProject = (pushProperty == null || pushProperty == 'jg') + ? project(':feature:jg_push') : project(':feature:acloud_push') + implementation(pushProject) { + exclude group: 'androidx.swiperefreshlayout' + } } File propFile = file('sign.properties') diff --git a/feature/jg_push/src/main/java/com/gh/gamecenter/jg/push/JPushHelper.kt b/feature/jg_push/src/main/java/com/gh/gamecenter/jg/push/JPushHelper.kt index 1d6d820afb..1d0cbf67d2 100644 --- a/feature/jg_push/src/main/java/com/gh/gamecenter/jg/push/JPushHelper.kt +++ b/feature/jg_push/src/main/java/com/gh/gamecenter/jg/push/JPushHelper.kt @@ -3,6 +3,7 @@ package com.gh.gamecenter.jg.push import android.annotation.SuppressLint import android.content.Context import android.os.Build +import cn.jiguang.api.utils.JCollectionAuth import cn.jpush.android.api.JPushInterface import com.alibaba.android.arouter.launcher.ARouter import com.gh.gamecenter.common.constant.RouteConsts @@ -18,6 +19,9 @@ object JPushHelper { private var badgeCount = 0 // 角标计数 fun init(applicationContext: Context) { + // 关闭SDK自启动 (https://docs.jiguang.cn/jverification/guideline/jghgzy) + JCollectionAuth.enableAutoWakeup(applicationContext, false) + JPushInterface.setDebugMode(BuildConfig.DEBUG) JPushInterface.init(applicationContext) }