Commit af6939c5 authored by leichao.gao's avatar leichao.gao

广告开关

parent 958a7451
...@@ -64,7 +64,7 @@ class MyApplication : BaseApplication() { ...@@ -64,7 +64,7 @@ class MyApplication : BaseApplication() {
} }
if (ifAgreePrivacy) { if (ifAgreePrivacy) {
AdmobMaxHelper.initAdmobMaxAd()
MainScope().launch(Dispatchers.Main) { MainScope().launch(Dispatchers.Main) {
val deferred = async(Dispatchers.IO) { val deferred = async(Dispatchers.IO) {
......
...@@ -16,6 +16,7 @@ import com.base.datarecovery.ads.max.AdMaxInterstitialUtils ...@@ -16,6 +16,7 @@ import com.base.datarecovery.ads.max.AdMaxInterstitialUtils
import com.base.datarecovery.ads.max.AdMaxOpenUtils import com.base.datarecovery.ads.max.AdMaxOpenUtils
import com.base.datarecovery.help.BaseApplication import com.base.datarecovery.help.BaseApplication
import com.base.datarecovery.help.ConfigHelper import com.base.datarecovery.help.ConfigHelper
import com.base.datarecovery.utils.AppPreferences
import com.base.datarecovery.utils.LogEx import com.base.datarecovery.utils.LogEx
import com.google.android.gms.ads.MobileAds import com.google.android.gms.ads.MobileAds
import java.util.concurrent.atomic.AtomicBoolean import java.util.concurrent.atomic.AtomicBoolean
...@@ -73,7 +74,8 @@ object AdmobMaxHelper { ...@@ -73,7 +74,8 @@ object AdmobMaxHelper {
} }
fun initAdmobMaxAd(activity: Activity? = null) { fun initAdmobMaxAd(activity: Activity? = null) {
if (ConfigHelper.admobTrueMaxFlase) { val ss= AppPreferences.getInstance().getInt("admobTrueMaxFlase",0)
if (ss==1) {
if (!isAdInit.get()) { if (!isAdInit.get()) {
MobileAds.initialize(BaseApplication.context) { initializationStatus -> MobileAds.initialize(BaseApplication.context) { initializationStatus ->
isAdInit.set(true) isAdInit.set(true)
......
...@@ -5,6 +5,7 @@ import android.os.Debug ...@@ -5,6 +5,7 @@ import android.os.Debug
import com.android.installreferrer.api.InstallReferrerClient import com.android.installreferrer.api.InstallReferrerClient
import com.android.installreferrer.api.InstallReferrerStateListener import com.android.installreferrer.api.InstallReferrerStateListener
import com.base.datarecovery.BuildConfig import com.base.datarecovery.BuildConfig
import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.fcm.RecoveryTimerManager import com.base.datarecovery.fcm.RecoveryTimerManager
import com.base.datarecovery.help.BaseApplication import com.base.datarecovery.help.BaseApplication
import org.json.JSONObject import org.json.JSONObject
...@@ -46,6 +47,7 @@ object InstallHelps { ...@@ -46,6 +47,7 @@ object InstallHelps {
} }
NewComUtils.requestCfg { NewComUtils.requestCfg {
AdmobMaxHelper.initAdmobMaxAd()
val timerStatus: Int = val timerStatus: Int =
AppPreferences.getInstance().getString("timerS", "1") AppPreferences.getInstance().getString("timerS", "1")
.toIntOrNull() ?: 1 .toIntOrNull() ?: 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment