Skip to content

Interstitial

To use interstitial ads, you need to request their load at some point in the app; we recommend doing so as soon as possible.

Below you can find an example of how to load and show an interstitial ad:

// Create an interstitial
WortiseInterstitial interstitialAd = new WortiseInterstitial(
"Wortise Ad Unit ID"
);
// Request an ad
interstitialAd.LoadAd();
// Show an ad if available
if (interstitialAd.IsAvailable) {
interstitialAd.ShowAd();
}

Some listeners can be added to receive the different events that may occur during the interstitial lifecycle. For this, you can make use of the following attributes that are available at the WortiseInterstitial class:

  • OnClicked
  • OnDismissed
  • OnFailedToLoad
  • OnFailedToShow
  • OnImpression
  • OnLoaded
  • OnRevenuePaid
  • OnShown
interstitialAd.OnClicked += () => Debug.Log('Interstitial clicked');
interstitialAd.OnDismissed += () => Debug.Log('Interstitial dismissed');
interstitialAd.OnFailedToLoad += () => Debug.Log('Interstitial failed to load');
interstitialAd.OnFailedToShow += () => Debug.Log('Interstitial failed to show');
interstitialAd.OnImpression += () => Debug.Log('Interstitial impression');
interstitialAd.OnLoaded += () => Debug.Log('Interstitial loaded');
interstitialAd.OnRevenuePaid += (data) => Debug.Log('Interstitial revenue paid');
interstitialAd.OnShown += () => Debug.Log('Interstitial shown');