Interstitials
1. Set the Interstitial Ad Delegate Method
Yodo1Mas.getInstance().setInterstitialListener new Yodo1Mas.InterstitialListener() { @Override public void onAdOpened(@NonNull Yodo1MasAdEvent event) { } @Override public void onAdError(@NonNull Yodo1MasAdEvent event, @NonNull Yodo1MasError error) { } @Override public void onAdClosed(@NonNull Yodo1MasAdEvent event) { } });
val interstitialListener: Yodo1Mas.InterstitialListener = object : Yodo1Mas.InterstitialListener() { override fun onAdOpened(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().setInterstitialListener(interstitialListener)
2. Check the Loading Status of Interstitials
boolean isLoaded = Yodo1Mas.getInstance().isInterstitialAdLoaded();
val isAdLoaded = Yodo1Mas.getInstance().isInterstitialAdLoaded()
3. Show Interstitial Ad
Yodo1Mas.getInstance().showInterstitialAd(MyActivity.this);
Yodo1Mas.getInstance().showInterstitialAd(this@MainActivity)