Преглед на файлове

Add RewardedVideoAd into HashMap

GameJob преди 4 години
родител
ревизия
f775e218ee
променени са 1 файла, в които са добавени 2 реда и са изтрити 3 реда
  1. 2 3
      src/main/java/com/kdanmobile/admanager/admob/AdMobRewardedAdManager.kt

+ 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 {