浏览代码

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 {