Unity Interstitial Configuration

1. Set the Interstitial Ad Delegate Method

MAS 4.3.2 and below

Yodo1U3dMas.SetInterstitialAdDelegate((Yodo1U3dAdEvent adEvent, Yodo1U3dAdError error) => {
    Debug.Log("[Yodo1 Mas] InterstitialAdDelegate:" + adEvent.ToString() + "\n" + error.ToString());
    switch (adEvent)
    {
        case Yodo1U3dAdEvent.AdClosed:
            Debug.Log("[Yodo1 Mas] Interstital ad has been closed.");
            break;
        case Yodo1U3dAdEvent.AdOpened:
            Debug.Log("[Yodo1 Mas] Interstital ad has been shown.");
            break;
        case Yodo1U3dAdEvent.AdError:
            Debug.Log("[Yodo1 Mas] Interstital ad error, " + error.ToString());
            break;
    }
});

MAS 4.4 and above, first integration

private void InitializeInterstitialAds()
{
    Yodo1U3dMasCallback.Interstitial.OnAdOpenedEvent +=    
    OnInterstitialAdOpenedEvent;
    Yodo1U3dMasCallback.Interstitial.OnAdClosedEvent +=      
    OnInterstitialAdClosedEvent;
    Yodo1U3dMasCallback.Interstitial.OnAdErrorEvent +=      
    OnInterstitialAdErorEvent;
}

private void OnInterstitialAdOpenedEvent()
{
    Debug.Log("[Yodo1 Mas] Interstitial ad opened");
}

private void OnInterstitialAdClosedEvent()
{
    Debug.Log("[Yodo1 Mas] Interstitial ad closed");
}

private void OnInterstitialAdErorEvent(Yodo1U3dAdError adError)
{
    Debug.Log("[Yodo1 Mas] Interstitial ad error - " + adError.ToString());
}

2. Check Interstitial Ad Loading Status

bool isLoaded = Yodo1U3dMas.IsInterstitialAdLoaded();


3. Show Interstitial Ads

Yodo1U3dMas.ShowInterstitialAd();

4. Create a Interstitial Placement

Simply add the placement name as a string in the parentheses.

Yodo1U3dMas.ShowInterstitialAd("Placement_Name");

You can find more details about the ad placements here.

Updated on December 20, 2021

Was this article helpful?

Related Articles