diff --git a/app/build.gradle b/app/build.gradle index 9661f9eca1..fc29a50e76 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -414,13 +414,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) }