소스 검색

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
                     }
                 }
             }