Hi! I try to follow the official tutorial. I don’t know what I did wrong for the reward ads. I have to placement already. There are two errors. first one is at starting.
ArgumentException: Ad Placement named ContinueRewardedAd does not exist.
Then when I click on button
NullReferenceException: Object reference not set to an instance of an object
TempButton.DisplayVideo () (at Assets/Scripts/TempButton.cs:29)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GoogleMobileAds;
using GoogleMobileAds.Api;
using GoogleMobileAds.Placement;
public class TempButton : MonoBehaviour
{
List<string> deviceIds = new List<string>();
RewardedAdGameObject RewardAds;
void Start()
{
RewardAds = MobileAds.Instance.GetAd<RewardedAdGameObject>("ContinueRewardedAd");
RewardAds.LoadAd();
this.gameObject.SetActive(true);
deviceIds.Add("2077ef9a63d2b398840261c8221a0c9b");
RequestConfiguration requestConfiguration = new RequestConfiguration.Builder().SetTestDeviceIds(deviceIds).build();
MobileAds.SetRequestConfiguration(requestConfiguration);
MobileAds.Initialize((initStatus) => {
Debug.Log("Initialized MobileRewardAds");
});
}
public void DisplayVideo()
{
// RewardAds.LoadAd();
RewardAds.ShowIfLoaded();
}
}