MAS Knowledge Base

MAS Knowledge Base

Docy

Interstitials

1. Configure the ad events

				
					Yodo1MasInterstitialAd.getInstance().setAdListener(new Yodo1MasInterstitialAdListener() {

  @Override
  public void onInterstitialAdLoaded(Yodo1MasInterstitialAd ad) {

  }

  @Override
  public void onInterstitialAdFailedToLoad(Yodo1MasInterstitialAd ad, @NonNull Yodo1MasError error) {

  }

  @Override
  public void onInterstitialAdOpened(Yodo1MasInterstitialAd ad) {
      
  }

  @Override
  public void onInterstitialAdFailedToOpen(Yodo1MasInterstitialAd ad, @NonNull Yodo1MasError error) {
       ad.loadAd(MainActivity.this);
  }

  @Override
  public void onInterstitialAdClosed(Yodo1MasInterstitialAd ad) {
       ad.loadAd(MainActivity.this);
  }
});
				
			
				
					Yodo1MasInterstitialAd.getInstance().setAdListener(object : Yodo1MasInterstitialAdListener {

    override fun onInterstitialAdLoaded(ad: Yodo1MasInterstitialAd?) {

    }

    override fun onInterstitialAdFailedToLoad(ad: Yodo1MasInterstitialAd?, error: Yodo1MasError) {

    }

    override fun onInterstitialAdOpened(ad: Yodo1MasInterstitialAd?) {

    }

    override fun onInterstitialAdFailedToOpen(ad: Yodo1MasInterstitialAd?,error: Yodo1MasError) {
        ad.loadAd(this@MainActivity)
    }

    override fun onInterstitialAdClosed(ad: Yodo1MasInterstitialAd?) {
         ad.loadAd(this@MainActivity)
    }
})
				
			

2. Load the ad

				
					Yodo1MasInterstitialAd.getInstance().loadAd(MainActivity.this);
				
			
				
					Yodo1MasInterstitialAd.getInstance().loadAd(this@MainActivity)
				
			

3. Show the ad

				
					boolean isLoaded = Yodo1MasInterstitialAd.getInstance().isLoaded();
if(isLoaded) Yodo1MasInterstitialAd.getInstance().showAd(MainActivity.this, "Your Placement");
				
			
				
					val isLoaded = Yodo1MasInterstitialAd.getInstance().isLoaded()
if(isLoaded) Yodo1MasInterstitialAd.getInstance().showAd(this@MainActivity, "Your Placement")
				
			
The ad placement parameter is optional. You can use it to analyze the performance of your ads or run an A/B test to help you optimize your monetization strategy.

You can learn more about the ad placements here.

4. Video tutorial

CONTENTS