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

update

parent fa93ed46
......@@ -7,6 +7,7 @@ import com.applovin.mediation.MaxAdRevenueListener
import com.applovin.sdk.AppLovinSdk
import com.base.datarecovery.help.BaseApplication
import com.base.datarecovery.utils.EventUtils
import com.base.datarecovery.utils.LogEx
import com.facebook.FacebookSdk
import com.google.firebase.analytics.FirebaseAnalytics
import com.google.firebase.analytics.ktx.analytics
......@@ -87,6 +88,7 @@ object AdMaxEvent {
class EventOnPaidEventListener : MaxAdRevenueListener {
override fun onAdRevenuePaid(ad: MaxAd) {
LogEx.logDebug("glc","onAdRevenuePaid")
val params = Bundle()
val currentImpressionRevenue: Double = ad.revenue // In USD
val mFirebaseAnalytics = FirebaseAnalytics.getInstance(BaseApplication.context)
......
......@@ -86,6 +86,7 @@ object AdMaxInterstitialUtils {
LogEx.logDebug(TAG, "onAdDisplayFailed")
}
})
interstitialAd?.setRevenueListener(AdMaxEvent.EventOnPaidEventListener())
}
}
......@@ -118,7 +119,6 @@ object AdMaxInterstitialUtils {
}
this.onHidden = onHidden
interstitialAd?.setRevenueListener(AdMaxEvent.EventOnPaidEventListener())
if (interstitialAd?.isReady == true) {
LogEx.logDebug(TAG, "isReady=true")
interstitialAd?.showAd()
......@@ -156,9 +156,6 @@ object AdMaxInterstitialUtils {
return
}
setListener(activity)
if (!AdDisplayUtils.getInstance().shouldShowAd()) {
return
}
if (AdMaxInit.isAdMaxInit.get()) {
LogEx.logDebug(TAG, "loadInterstitialAd")
interstitialAd?.loadAd()
......
......@@ -108,12 +108,7 @@ object AdMaxNativeUtils {
fun showNativeAd(activity: Activity, parent: ViewGroup, layout: Int ) {
setNativeAdListener()
val obj = JSONObject()
obj.put("ad_unit", "NativeAd")
EventUtils.event("ad_prepare_show", ext = obj)
if (!AdDisplayUtils.getInstance().shouldShowAd()) {
return
}
......
......@@ -70,9 +70,7 @@ object AdMaxOpenUtils {
}
})
appOpenAd?.setRevenueListener { ad ->
}
appOpenAd?.setRevenueListener (AdMaxEvent.EventOnPaidEventListener())
}
}
......@@ -111,7 +109,6 @@ object AdMaxOpenUtils {
if (appOpenAd?.isReady == true) {
LogEx.logDebug(TAG, "isReady=false")
appOpenAd?.setRevenueListener(AdMaxEvent.EventOnPaidEventListener())
appOpenAd?.showAd()
} else {
appOpenAd?.loadAd()
......
......@@ -215,7 +215,7 @@ object NotificationUtil {
fun sendNotification(context: Context) {
val currentNum = AppPreferences.getInstance().getInt("showNotificationCount_" + AdDisplayUtils.getInstance().getCurrentDate(), 0)
val maxNum = AppPreferences.getInstance().getInt("maxShowNotificationCount", 100)
val maxNum = AppPreferences.getInstance().getString("maxShowNotificationCount", "100").toIntOrNull()?:100
if (currentNum >= maxNum) {
return
}
......
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