diff --git a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/activities/ads/admob/AdMobVideoRewardedActivity.kt b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/activities/ads/admob/AdMobVideoRewardedActivity.kt index 73f4c8348..6d9702ec3 100644 --- a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/activities/ads/admob/AdMobVideoRewardedActivity.kt +++ b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/activities/ads/admob/AdMobVideoRewardedActivity.kt @@ -60,7 +60,9 @@ class AdMobVideoRewardedActivity : BaseAdActivity() { override fun onAdLoaded(ad: RewardedAd) { Log.d("AdMobRewarded", "Ad was loaded.") rewardedAd = ad - rewardedAd?.show(this@AdMobVideoRewardedActivity) {} + rewardedAd?.show(this@AdMobVideoRewardedActivity) { + Log.d("AdExample", "User earned reward: ${it.amount} ${it.type}") + } } override fun onAdFailedToLoad(adError: LoadAdError) { diff --git a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/activities/ads/applovin/AppLovinMaxVideoRewardedActivity.kt b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/activities/ads/applovin/AppLovinMaxVideoRewardedActivity.kt index 6c7f5d132..97295925f 100644 --- a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/activities/ads/applovin/AppLovinMaxVideoRewardedActivity.kt +++ b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/activities/ads/applovin/AppLovinMaxVideoRewardedActivity.kt @@ -16,6 +16,7 @@ package org.prebid.mobile.prebidkotlindemo.activities.ads.applovin import android.os.Bundle +import android.util.Log import com.applovin.mediation.MaxAd import com.applovin.mediation.MaxError import com.applovin.mediation.MaxReward @@ -56,7 +57,9 @@ class AppLovinMaxVideoRewardedActivity : BaseAdActivity() { override fun onAdDisplayFailed(ad: MaxAd?, error: MaxError?) {} override fun onRewardedVideoStarted(ad: MaxAd?) {} override fun onRewardedVideoCompleted(ad: MaxAd?) {} - override fun onUserRewarded(ad: MaxAd?, reward: MaxReward?) {} + override fun onUserRewarded(ad: MaxAd?, reward: MaxReward?) { + Log.d("AdExample", "User earned reward: $reward") + } }) val mediationUtils = MaxMediationRewardedUtils(maxRewardedAd) diff --git a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/activities/ads/gam/rendering/GamRenderingApiVideoRewardedActivity.kt b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/activities/ads/gam/rendering/GamRenderingApiVideoRewardedActivity.kt index 04103a141..bb50a2481 100644 --- a/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/activities/ads/gam/rendering/GamRenderingApiVideoRewardedActivity.kt +++ b/Example/PrebidDemoKotlin/src/main/java/org/prebid/mobile/prebidkotlindemo/activities/ads/gam/rendering/GamRenderingApiVideoRewardedActivity.kt @@ -53,7 +53,7 @@ class GamRenderingApiVideoRewardedActivity : BaseAdActivity() { override fun onAdClicked(rewardedAdUnit: RewardedAdUnit?) {} override fun onAdClosed(rewardedAdUnit: RewardedAdUnit?) {} override fun onUserEarnedReward(rewardedAdUnit: RewardedAdUnit?, reward: Reward?) { - Log.d("AdActivity", "User earned reward: $reward") + Log.d("AdExample", "User earned reward: $reward") } }) adUnit?.loadAd() diff --git a/Example/PrebidInternalTestApp/src/main/java/org/prebid/mobile/renderingtestapp/plugplay/bidding/admob/AdMobRewardedFragment.kt b/Example/PrebidInternalTestApp/src/main/java/org/prebid/mobile/renderingtestapp/plugplay/bidding/admob/AdMobRewardedFragment.kt index 9f8bc5d94..b72ac1706 100644 --- a/Example/PrebidInternalTestApp/src/main/java/org/prebid/mobile/renderingtestapp/plugplay/bidding/admob/AdMobRewardedFragment.kt +++ b/Example/PrebidInternalTestApp/src/main/java/org/prebid/mobile/renderingtestapp/plugplay/bidding/admob/AdMobRewardedFragment.kt @@ -115,6 +115,7 @@ open class AdMobRewardedFragment : AdFragment() { val rewardAmount = rewardItem.amount val rewardType = rewardItem.type Log.d(TAG, "User earned the reward ($rewardAmount, $rewardType)") + events.rewarded(true) } binding.btnLoad.text = getString(R.string.text_retry) } else if (binding.btnLoad.text == getString(R.string.text_retry)) { @@ -155,6 +156,7 @@ open class AdMobRewardedFragment : AdFragment() { fun impression(b: Boolean) = enable(R.id.btnAdImpression, b) fun clicked(b: Boolean) = enable(R.id.btnAdClicked, b) fun failed(b: Boolean) = enable(R.id.btnAdFailed, b) + fun rewarded(b: Boolean) = enable(R.id.btnUserRewarded, b) fun showed(b: Boolean) = enable(R.id.btnAdShowed, b) fun dismissed(b: Boolean) = enable(R.id.btnAdDismissed, b) diff --git a/Example/PrebidInternalTestApp/src/main/java/org/prebid/mobile/renderingtestapp/plugplay/bidding/base/BaseBidRewardedFragment.kt b/Example/PrebidInternalTestApp/src/main/java/org/prebid/mobile/renderingtestapp/plugplay/bidding/base/BaseBidRewardedFragment.kt index cf5e1a223..ed174724f 100644 --- a/Example/PrebidInternalTestApp/src/main/java/org/prebid/mobile/renderingtestapp/plugplay/bidding/base/BaseBidRewardedFragment.kt +++ b/Example/PrebidInternalTestApp/src/main/java/org/prebid/mobile/renderingtestapp/plugplay/bidding/base/BaseBidRewardedFragment.kt @@ -114,6 +114,7 @@ abstract class BaseBidRewardedFragment : AdFragment() { } override fun onUserEarnedReward(rewardedAdUnit: RewardedAdUnit?, reward: Reward?) { + Log.d(TAG, "User earned reward: $reward") events.reward(true) } diff --git a/Example/PrebidInternalTestApp/src/main/java/org/prebid/mobile/renderingtestapp/plugplay/bidding/max/MaxRewardedFragment.kt b/Example/PrebidInternalTestApp/src/main/java/org/prebid/mobile/renderingtestapp/plugplay/bidding/max/MaxRewardedFragment.kt index 0aa2fc6b6..08cc638c5 100644 --- a/Example/PrebidInternalTestApp/src/main/java/org/prebid/mobile/renderingtestapp/plugplay/bidding/max/MaxRewardedFragment.kt +++ b/Example/PrebidInternalTestApp/src/main/java/org/prebid/mobile/renderingtestapp/plugplay/bidding/max/MaxRewardedFragment.kt @@ -3,8 +3,6 @@ package org.prebid.mobile.renderingtestapp.plugplay.bidding.max import android.os.Bundle import android.util.Log import android.view.View -import android.widget.Button -import android.widget.TextView import com.applovin.mediation.MaxAd import com.applovin.mediation.MaxError import com.applovin.mediation.MaxReward @@ -17,7 +15,6 @@ import org.prebid.mobile.renderingtestapp.R import org.prebid.mobile.renderingtestapp.databinding.FragmentBiddingRewardedApplovinMaxBinding import org.prebid.mobile.renderingtestapp.plugplay.config.AdConfiguratorDialogFragment import org.prebid.mobile.renderingtestapp.utils.BaseEvents -import org.prebid.mobile.renderingtestapp.widgets.EventCounterView open class MaxRewardedFragment : AdFragment() { @@ -139,6 +136,7 @@ open class MaxRewardedFragment : AdFragment() { } override fun onUserRewarded(ad: MaxAd?, reward: MaxReward?) { + Log.d(TAG, "User earned reward: ${reward?.label} ${reward?.amount}") events.userRewarded(true) } } diff --git a/Example/PrebidInternalTestApp/src/main/java/org/prebid/mobile/renderingtestapp/utils/DemoItemProvider.kt b/Example/PrebidInternalTestApp/src/main/java/org/prebid/mobile/renderingtestapp/utils/DemoItemProvider.kt index 7f69b6cca..1c7f7756b 100644 --- a/Example/PrebidInternalTestApp/src/main/java/org/prebid/mobile/renderingtestapp/utils/DemoItemProvider.kt +++ b/Example/PrebidInternalTestApp/src/main/java/org/prebid/mobile/renderingtestapp/utils/DemoItemProvider.kt @@ -1134,7 +1134,7 @@ class DemoItemProvider private constructor() { DemoItem( getString(R.string.demo_bidding_in_app_display_rewarded_time), ppmRewardedAction, - ppmInterstitialTagList, + ppmVideoTagList, createBannerBundle( R.string.imp_prebid_id_display_rewarded_time, null, @@ -1147,7 +1147,7 @@ class DemoItemProvider private constructor() { DemoItem( getString(R.string.demo_bidding_in_app_display_rewarded_event), ppmRewardedAction, - ppmInterstitialTagList, + ppmVideoTagList, createBannerBundle( R.string.imp_prebid_id_display_rewarded_event, null, @@ -1160,7 +1160,7 @@ class DemoItemProvider private constructor() { DemoItem( getString(R.string.demo_bidding_in_app_display_rewarded_default), ppmRewardedAction, - ppmInterstitialTagList, + ppmVideoTagList, createBannerBundle( R.string.imp_prebid_id_display_rewarded_default, null, @@ -1173,7 +1173,7 @@ class DemoItemProvider private constructor() { DemoItem( getString(R.string.demo_bidding_in_app_video_rewarded_time), ppmRewardedAction, - ppmInterstitialTagList, + ppmVideoTagList, createBannerBundle( R.string.imp_prebid_id_video_rewarded_time, null, @@ -1186,7 +1186,7 @@ class DemoItemProvider private constructor() { DemoItem( getString(R.string.demo_bidding_in_app_video_rewarded_event), ppmRewardedAction, - ppmInterstitialTagList, + ppmVideoTagList, createBannerBundle( R.string.imp_prebid_id_video_rewarded_event, null, @@ -1199,7 +1199,7 @@ class DemoItemProvider private constructor() { DemoItem( getString(R.string.demo_bidding_in_app_video_rewarded_default), ppmRewardedAction, - ppmInterstitialTagList, + ppmVideoTagList, createBannerBundle( R.string.imp_prebid_id_video_rewarded_default, null, @@ -1212,7 +1212,7 @@ class DemoItemProvider private constructor() { DemoItem( getString(R.string.demo_bidding_in_app_video_rewarded_endcard_time), ppmRewardedAction, - ppmInterstitialTagList, + ppmVideoTagList, createBannerBundle( R.string.imp_prebid_id_video_rewarded_endcard_time, null, @@ -1225,7 +1225,7 @@ class DemoItemProvider private constructor() { DemoItem( getString(R.string.demo_bidding_in_app_video_rewarded_endcard_event), ppmRewardedAction, - ppmInterstitialTagList, + ppmVideoTagList, createBannerBundle( R.string.imp_prebid_id_video_rewarded_endcard_event, null, @@ -1238,7 +1238,7 @@ class DemoItemProvider private constructor() { DemoItem( getString(R.string.demo_bidding_in_app_video_rewarded_endcard_default), ppmRewardedAction, - ppmInterstitialTagList, + ppmVideoTagList, createBannerBundle( R.string.imp_prebid_id_video_rewarded_endcard_default, null, diff --git a/Example/PrebidInternalTestApp/src/main/res/layout/events_admob_rewarded.xml b/Example/PrebidInternalTestApp/src/main/res/layout/events_admob_rewarded.xml index 27a7f18aa..4248b8e5b 100644 --- a/Example/PrebidInternalTestApp/src/main/res/layout/events_admob_rewarded.xml +++ b/Example/PrebidInternalTestApp/src/main/res/layout/events_admob_rewarded.xml @@ -69,4 +69,11 @@ android:text="@string/event_admob_failed" android:layout_marginTop="@dimen/event_top_margin"/> + + \ No newline at end of file