Commit d4e8ed74 authored by wanglei's avatar wanglei

...

parent 134049a6
......@@ -92,7 +92,9 @@ class MyApplication : BaseApplication() {
private fun initLifeListener() {
registerActivityLifecycleCallbacks(object : ActivityLifecycleCallbacks {
private var count = 0
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {}
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
ActivityManagerUtils.getInstance().addActivity(activity)
}
override fun onActivityStarted(activity: Activity) {
LogEx.logDebug(TAG, "onActivityStarted")
......@@ -157,7 +159,9 @@ class MyApplication : BaseApplication() {
override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {}
override fun onActivityDestroyed(activity: Activity) {}
override fun onActivityDestroyed(activity: Activity) {
ActivityManagerUtils.getInstance().removeActivity(activity)
}
})
}
......
......@@ -101,9 +101,9 @@ object AdmobNativeUtils {
if (nativeAd == null) {
loadNativeAd()
val obj2 = JSONObject()
obj2.put("reason", "no_ad")
obj2.put("reason", "no coach ad")
obj2.put("ad_unit", "nativeAd")
EventUtils.event("ad_show_error", ext = obj2)
EventUtils.event("ad_nocache_pull", ext = obj2)
} else {
loadingListener?.invoke()
}
......
......@@ -124,9 +124,9 @@ object AdMaxInterstitialUtils {
} else {
LogEx.logDebug(TAG, "展示广告时,没有缓存,需要拉取。")
val obj2 = JSONObject()
obj2.put("reason", "no ad")
obj2.put("reason", "no cache ad")
obj2.put("ad_unit", "interAd")
EventUtils.event("ad_show_error", ext = obj2)
EventUtils.event("ad_nocache_pull", ext = obj2)
val loaded = loadInterstitialAd(activity)
if (loaded) {
LogEx.logDebug(TAG, "loaded=true")
......
......@@ -141,9 +141,9 @@ object AdMaxNativeUtils {
if (nativeAd == null) {
nativeAdLoader.loadAd()
val obj2 = JSONObject()
obj2.put("reason", "no_ad")
obj2.put("reason", "no_cache_ad")
obj2.put("ad_unit", "nativeAd")
EventUtils.event("ad_show_error", ext = obj2)
EventUtils.event("ad_nocache_pull", ext = obj2)
} else {
loadingListener?.invoke()
}
......
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