Bladeren bron

Add RewardedAdListener & RewardedAdItem

GameJob 4 jaren geleden
bovenliggende
commit
b4c9532650

+ 9 - 0
src/main/java/com/kdanmobile/admanager/RewardedAdItem.kt

@@ -0,0 +1,9 @@
+package com.kdanmobile.admanager
+
+import com.google.android.gms.ads.reward.RewardItem
+
+data class RewardedAdItem(val type: String?, val amount: Int)
+
+fun RewardItem.toRewardedAdItem(): RewardedAdItem {
+    return RewardedAdItem(type, amount)
+}

+ 12 - 0
src/main/java/com/kdanmobile/admanager/RewardedAdListener.kt

@@ -0,0 +1,12 @@
+package com.kdanmobile.admanager
+
+interface RewardedAdListener {
+    fun onRewardedAdLoaded(adUnitId: String)
+    fun onRewardedAdOpened(adUnitId: String)
+    fun onRewardedAdStarted(adUnitId: String)
+    fun onRewardedAdClosed(adUnitId: String)
+    fun onRewardedAdCompleted(adUnitId: String)
+    fun onRewardedAdLeftApplication(adUnitId: String)
+    fun onRewardedAdFailedToLoad(adUnitId: String, errorCode: Int)
+    fun onRewarded(adUnitId: String, item: RewardedAdItem?)
+}