Commit de944271 authored by wanglei's avatar wanglei

...

parent cd1d0688
package com.base.locationsharewhite.ads package com.base.locationsharewhite.ads
import AdInsertMgr
import android.app.Activity import android.app.Activity
import android.content.Context import android.content.Context
import android.view.ViewGroup import android.view.ViewGroup
import com.base.locationsharewhite.ads.admob.AdBannerMgr import com.base.locationsharewhite.ads.admob.AdBannerMgr
import com.base.locationsharewhite.ads.admob.AdInsertMgr
import com.base.locationsharewhite.ads.admob.AdNativeMgr import com.base.locationsharewhite.ads.admob.AdNativeMgr
import com.base.locationsharewhite.ads.admob.AdOpenMgr import com.base.locationsharewhite.ads.admob.AdOpenMgr
import com.google.android.gms.ads.MobileAds import com.google.android.gms.ads.MobileAds
...@@ -70,10 +70,10 @@ object AdsMgr { ...@@ -70,10 +70,10 @@ object AdsMgr {
* @param showCallBack 展示回调 * @param showCallBack 展示回调
*/ */
fun showOpen(activity: Activity, showCallBack: AdsShowCallBack? = null) { fun showOpen(activity: Activity, showCallBack: AdsShowCallBack? = null) {
if (!isInit || adsConfigBean?.isInBlackList != false) { // if (!isInit || adsConfigBean?.isInBlackList != false) {
showCallBack?.failed() // showCallBack?.failed()
return // return
} // }
adOpenMgr.show(activity, showCallBack) adOpenMgr.show(activity, showCallBack)
} }
......
...@@ -4,4 +4,5 @@ abstract class AdsShowCallBack { ...@@ -4,4 +4,5 @@ abstract class AdsShowCallBack {
open fun show() {} open fun show() {}
abstract fun close() abstract fun close()
abstract fun failed() abstract fun failed()
abstract fun googleFailed()
} }
\ No newline at end of file
package com.base.locationsharewhite.ads.admob
import android.app.Activity import android.app.Activity
import android.content.Context import android.content.Context
import com.base.locationsharewhite.ads.AdsShowCallBack import com.base.locationsharewhite.ads.AdsShowCallBack
import com.base.locationsharewhite.ads.BaseAdMgr import com.base.locationsharewhite.ads.BaseAdMgr
import com.base.locationsharewhite.ads.admob.LimitUtils
import com.base.locationsharewhite.helper.config.ConstConfig import com.base.locationsharewhite.helper.config.ConstConfig
import com.google.android.gms.ads.AdError import com.google.android.gms.ads.AdError
import com.google.android.gms.ads.AdRequest import com.google.android.gms.ads.AdRequest
...@@ -40,7 +39,7 @@ class AdInsertMgr : BaseAdMgr<InterstitialAd>() { ...@@ -40,7 +39,7 @@ class AdInsertMgr : BaseAdMgr<InterstitialAd>() {
// 如果确实需要,则必须限制最大重试次数,避免在网络受限的情况下连续多次请求 // 如果确实需要,则必须限制最大重试次数,避免在网络受限的情况下连续多次请求
loadingAd = false loadingAd = false
if (activityRef != null && !showingAd && showCallBack != null) { if (activityRef != null && !showingAd && showCallBack != null) {
showCallBack?.failed() showCallBack?.googleFailed()
showCallBack = null showCallBack = null
} }
} }
...@@ -108,7 +107,7 @@ class AdInsertMgr : BaseAdMgr<InterstitialAd>() { ...@@ -108,7 +107,7 @@ class AdInsertMgr : BaseAdMgr<InterstitialAd>() {
showingAd = false showingAd = false
currentAd = null currentAd = null
activityRef = null activityRef = null
this@AdInsertMgr.showCallBack?.failed() this@AdInsertMgr.showCallBack?.googleFailed()
this@AdInsertMgr.showCallBack = null this@AdInsertMgr.showCallBack = null
} }
......
...@@ -39,7 +39,7 @@ class AdOpenMgr : BaseAdMgr<AppOpenAd>() { ...@@ -39,7 +39,7 @@ class AdOpenMgr : BaseAdMgr<AppOpenAd>() {
// 如果确实需要,则必须限制最大重试次数,避免在网络受限的情况下连续多次请求 // 如果确实需要,则必须限制最大重试次数,避免在网络受限的情况下连续多次请求
loadingAd = false loadingAd = false
if (activityRef != null && !showingAd && showCallBack != null) { if (activityRef != null && !showingAd && showCallBack != null) {
showCallBack?.failed() showCallBack?.googleFailed()
showCallBack = null showCallBack = null
} }
} }
...@@ -107,7 +107,7 @@ class AdOpenMgr : BaseAdMgr<AppOpenAd>() { ...@@ -107,7 +107,7 @@ class AdOpenMgr : BaseAdMgr<AppOpenAd>() {
showingAd = false showingAd = false
currentAd = null currentAd = null
activityRef = null activityRef = null
this@AdOpenMgr.showCallBack?.failed() this@AdOpenMgr.showCallBack?.googleFailed()
this@AdOpenMgr.showCallBack = null this@AdOpenMgr.showCallBack = null
} }
......
...@@ -84,6 +84,11 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>(), SplashView { ...@@ -84,6 +84,11 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>(), SplashView {
jumpNext() jumpNext()
} }
override fun googleFailed() {
LogEx.logDebug(TAG, "AdsShowCallBack googleFailed")
jumpNext()
}
}) })
splashPresenter.startJumpJob = true splashPresenter.startJumpJob = true
......
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