Rewarded Ads

1. Set Up Rewarded Video Ad Delegate Methods

Yodo1Mas.getInstance().setRewardListener(
new Yodo1Mas.RewardListener() {
@Override public void onAdOpened(@NonNull Yodo1MasAdEvent event) { }
@Override public void onAdvertRewardEarned(@NonNull Yodo1MasAdEvent event) { }
@Override public void onAdError(@NonNull Yodo1MasAdEvent event,
@NonNull Yodo1MasError error) { }
@Override public void onAdClosed(
@NonNull Yodo1MasAdEvent event) { } });
val rewardListener: RewardListener = 
object : RewardListener() { 
override fun onAdOpened(event: Yodo1MasAdEvent) { }
override fun onAdvertRewardEarned(event: Yodo1MasAdEvent) { }
override fun onAdError(event: Yodo1MasAdEvent, error: Yodo1MasError) {
Toast.makeText(this@MainActivity, error.message, Toast.LENGTH_SHORT).show() }
override fun onAdClosed(event: Yodo1MasAdEvent) { } }
Yodo1Mas.getInstance().setRewardListener(rewardListener)

2. Check the Loading Status of Rewarded Video Ads

boolean isLoaded =
Yodo1Mas.getInstance().isRewardedAdLoaded();
val isAdLoaded =
Yodo1Mas.getInstance().isRewardedAdLoaded()

3. Show Rewarded Video Ads

Yodo1Mas.getInstance().showRewardedAd(MyActivity.this);
Yodo1Mas.getInstance().showRewardedAd(this@MainActivity)

CONTENTS