Commit ac5769c2 authored by wanglei's avatar wanglei

...

parent 1c4ec92b
......@@ -82,7 +82,7 @@ object AdmobNativeUtils {
fun showNativeAd(activity: Activity?, parent: ViewGroup, layout: Int = R.layout.layout_native_custom) {
val obj = JSONObject()
obj.put("ad_unit", "NativeAd")
EventUtils.event("ad_prepare_show", ext = obj)
EventUtils.event("ad_prepare_show_native", ext = obj)
if (!AdDisplayUtils.getInstance().shouldShowAd("NativeAd")) {
return
}
......
......@@ -67,7 +67,12 @@ object AdmobOpenUtils {
}
fun showAppOpenAd(activity: Activity, showBefore: ((flag: Boolean) -> Unit)? = null, onHidden: ((where: Int) -> Unit)? = null) {
fun showAppOpenAd(
activity: Activity,
isRetry: Boolean = false,
showBefore: ((flag: Boolean) -> Unit)? = null,
onHidden: ((where: Int) -> Unit)? = null
) {
if (activity.isFinishing || activity.isDestroyed) {
return
......@@ -76,9 +81,11 @@ object AdmobOpenUtils {
onHidden?.invoke(1)
return
}
if (isRetry){
val obj1 = JSONObject()
obj1.put("ad_unit", "openAd")
EventUtils.event("ad_prepare_show", ext = obj1)
}
if (System.currentTimeMillis() - openLoadTime > 1000 * 60 * 60) {
LogEx.logDebug(TAG, "openLoadTime out time")
mOpenAd = null
......@@ -133,7 +140,7 @@ object AdmobOpenUtils {
LogEx.logDebug(TAG, "mOpenAd=null")
loadAppOpenAd {
if (mOpenAd != null) {
showAppOpenAd(activity, showBefore, onHidden)
showAppOpenAd(activity, true, showBefore, onHidden)
} else {
val obj = JSONObject()
obj.put("reason", "no_ad")
......
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