Rewarded Interstitial

Create a request to load the ad.

You should call this part of the code once at the beginning.

using UnityEngine;
using AdManagerPro;
public class Test : MonoBehaviour
{
    private void Start()
    {
        // Requests to download advertisements
        RewardedInterstitialAdManager.RequestRewardedInterstitialAd();
    }
}

Show Rewarded Interstitial ADS

To show rewarded interstitial ads, you can use the following code snippet:

RewardedInterstitialAdManager.ShowRewardedInterstitialAd(OnAdWatched);

ОnAdWatched is a delegate used as a callback after a rewarded ad has either been shown and watched or not shown. This delegate takes a single parameter of type bool, which indicates whether the ad was watched.

Implement a method for the player to receive a reward.

private void OnAdWatched(bool adWatched)
    {
        if (adWatched)
        {
            Debug.Log("Ad watched, reward added!");
        }
        else
        {
            Debug.Log("Ad was not watched.");
        }
    }

If you need to check the availability/loading status of the ad, include the following code snippet:

using UnityEngine;
using AdManagerPro;
public class Test : MonoBehaviour
{
    private void Start()
    {
        if(RewardedInterstitialAdManager.isAdmobRewardedInterstitialReady){
            Debug.Log("The ad is available.");
        }
    }
}

Last updated