Bläddra i källkod

Add RewardedVideoAd into HashMap

GameJob 4 år sedan
förälder
incheckning
f775e218ee

+ 2 - 3
src/main/java/com/kdanmobile/admanager/admob/AdMobRewardedAdManager.kt

@@ -25,10 +25,9 @@ class AdMobRewardedAdManager: RewardedAdManager {
     }
 
     override fun request(activity: Activity, adUnitId: String) {
-        rewardedVideoAdMap[adUnitId] ?: kotlin.run {
+        rewardedVideoAdMap[adUnitId] ?: run {
             rewardedAdStatusMap[adUnitId] = RewardedAdStatus.NOT_INIT
-
-            MobileAds.getRewardedVideoAdInstance(activity.application).apply {
+            rewardedVideoAdMap[adUnitId] = MobileAds.getRewardedVideoAdInstance(activity.application).apply {
                 rewardedVideoAdListener = object : RewardedVideoAdListener {
                     override fun onRewardedVideoAdClosed() {
                         adListeners.forEach {