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

update

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