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

Set status before running callbacks

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

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

@@ -52,10 +52,10 @@ class AdMobRewardedAdManager: RewardedAdManager {
                     }
 
                     override fun onRewardedVideoAdLoaded() {
+                        rewardedAdDataMap[adUnitId]?.status = RewardedAdStatus.LOADED
                         adListeners.forEach {
                             it.onRewardedAdLoaded(adUnitId)
                         }
-                        rewardedAdDataMap[adUnitId]?.status = RewardedAdStatus.LOADED
                     }
 
                     override fun onRewardedVideoAdOpened() {
@@ -84,10 +84,10 @@ class AdMobRewardedAdManager: RewardedAdManager {
                     }
 
                     override fun onRewardedVideoAdFailedToLoad(errorCode: Int) {
+                        rewardedAdDataMap[adUnitId]?.status = RewardedAdStatus.FAILED
                         adListeners.forEach {
                             it.onRewardedAdFailedToLoad(adUnitId, errorCode)
                         }
-                        rewardedAdDataMap[adUnitId]?.status = RewardedAdStatus.FAILED
                     }
                 }
             }