Interstitial

Integration

To make use of interstitial ads, it is needed to request their load at some point inside the app, being recommended to do it 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();
}

Listener configuration

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

  • OnShown

Example

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.OnShown        += () => Debug.Log('Interstitial shown');

Last updated