Commit 5a514230 authored by wanglei's avatar wanglei

...

parent 87f8b950
...@@ -110,6 +110,8 @@ dependencies { ...@@ -110,6 +110,8 @@ dependencies {
implementation 'com.google.firebase:firebase-analytics:21.6.2' implementation 'com.google.firebase:firebase-analytics:21.6.2'
implementation("com.google.firebase:firebase-messaging") implementation("com.google.firebase:firebase-messaging")
//max adjust 归因
implementation 'com.adjust.sdk:adjust-android:4.28.7' //google 内购订阅
def billing_version = "7.0.0"
implementation "com.android.billingclient:billing:$billing_version"
} }
\ No newline at end of file
...@@ -81,10 +81,10 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() { ...@@ -81,10 +81,10 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
progressCollect() progressCollect()
if (ifAgreePrivacy) { if (ifAgreePrivacy) {
AdmobMaxHelper.preloadAd(this)
job = startProgress() job = startProgress()
binding.llStart.visibility = View.GONE binding.llStart.visibility = View.GONE
binding.llProgress.visibility = View.VISIBLE binding.llProgress.visibility = View.VISIBLE
preloadAd()
} else { } else {
binding.llStart.visibility = View.VISIBLE binding.llStart.visibility = View.VISIBLE
binding.llProgress.visibility = View.GONE binding.llProgress.visibility = View.GONE
...@@ -108,19 +108,6 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() { ...@@ -108,19 +108,6 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
} }
} }
private fun preloadAd() {
if (ConfigHelper.admobTrueMaxFlase) {
AdmobNativeUtils.loadNativeAd()
AdmobInterstitialUtils.loadInterstitialAd(this)
} else {
AdMaxInit.maxInitAction = {
AdMaxOpenUtils.loadAppOpenAd(this)
AdMaxInterstitialUtils.loadInterstitialAd(this)
AdMaxNativeUtils.loadNativeAd()
}
}
}
private fun progressCollect() { private fun progressCollect() {
lifecycleScope.launch { lifecycleScope.launch {
progressFlow.collectLatest { progressFlow.collectLatest {
...@@ -207,7 +194,7 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() { ...@@ -207,7 +194,7 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
oneClickStart = true oneClickStart = true
ifAgreePrivacy = true ifAgreePrivacy = true
(application as MyApplication).initApp() (application as MyApplication).initApp()
preloadAd() AdmobMaxHelper.preloadAd(this)
binding.llStart.visibility = View.GONE binding.llStart.visibility = View.GONE
binding.llProgress.visibility = View.VISIBLE binding.llProgress.visibility = View.VISIBLE
job = startProgress() job = startProgress()
......
package com.base.filerecoveryrecyclebin.ads package com.base.filerecoveryrecyclebin.ads
import android.app.Activity import android.app.Activity
import android.util.Log
import android.view.ViewGroup import android.view.ViewGroup
import com.base.filerecoveryrecyclebin.R import com.base.filerecoveryrecyclebin.R
import com.base.filerecoveryrecyclebin.ads.admob.AdmobInterstitialUtils import com.base.filerecoveryrecyclebin.ads.admob.AdmobInterstitialUtils
import com.base.filerecoveryrecyclebin.ads.admob.AdmobNativeUtils import com.base.filerecoveryrecyclebin.ads.admob.AdmobNativeUtils
import com.base.filerecoveryrecyclebin.ads.admob.AdmobOpenUtils import com.base.filerecoveryrecyclebin.ads.admob.AdmobOpenUtils
import com.base.filerecoveryrecyclebin.ads.max.AdMaxInit
import com.base.filerecoveryrecyclebin.ads.max.AdMaxInit.initAdMax import com.base.filerecoveryrecyclebin.ads.max.AdMaxInit.initAdMax
import com.base.filerecoveryrecyclebin.ads.max.AdMaxInterstitialUtils import com.base.filerecoveryrecyclebin.ads.max.AdMaxInterstitialUtils
import com.base.filerecoveryrecyclebin.ads.max.AdMaxNativeUtils import com.base.filerecoveryrecyclebin.ads.max.AdMaxNativeUtils
...@@ -73,4 +75,22 @@ object AdmobMaxHelper { ...@@ -73,4 +75,22 @@ object AdmobMaxHelper {
} }
} }
fun preloadAd(activity: Activity) {
if (ConfigHelper.admobTrueMaxFlase) {
AdmobOpenUtils.loadAppOpenAd()
AdmobInterstitialUtils.loadInterstitialAd(activity)
} else {
if (isAdInit.get()) {
AdMaxOpenUtils.loadAppOpenAd(activity)
AdMaxInterstitialUtils.loadInterstitialAd(activity)
} else {
AdMaxInit.maxInitAction = {
Log.d(TAG, "max init suc")
AdMaxOpenUtils.loadAppOpenAd(activity)
AdMaxInterstitialUtils.loadInterstitialAd(activity)
}
}
}
}
} }
\ No newline at end of file
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