Rewarded
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
RewardedAdManager.RequestRewardedAd();
}
}
Show Rewarded ADS
To show rewarded ads, you can use the following code snippet:
RewardedAdManager.ShowRewardedAd(OnAdWatched);
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(RewardedAdManager.isAdmobRewardedReady){
Debug.Log("The ad is available.");
}
}
}
Last updated