as the question says
all i can add is the script i’m using
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GoogleMobileAds;
using GoogleMobileAds.Api;
using UnityEngine.UI;
public class RewardVid : MonoBehaviour {
Text ready_text;
private RewardBasedVideoAd rewardBasedVideoAd;
// Use this for initialization
void Start () {
rewardBasedVideoAd = RewardBasedVideoAd.Instance;
rewardBasedVideoAd.OnAdLoaded += HandleOnAdLoaded;
rewardBasedVideoAd.OnAdFailedToLoad += HandleOnAdFailedToLoad;
rewardBasedVideoAd.OnAdOpening += HandleOnAdOpening;
rewardBasedVideoAd.OnAdStarted += HandleOnAdStarted;
rewardBasedVideoAd.OnAdRewarded += HandleOnAdRewarded;
rewardBasedVideoAd.OnAdClosed += HandleOnAdClosed;
rewardBasedVideoAd.OnAdLeavingApplication += HandleOnAdLeavingApplication;
LoadRewardBasedAd ();
}
// Update is called once per frame
void Update () {
rewardBasedVideoAd.OnAdLoaded += HandleOnAdLoaded;
rewardBasedVideoAd.OnAdFailedToLoad += HandleOnAdFailedToLoad;
rewardBasedVideoAd.OnAdOpening += HandleOnAdOpening;
rewardBasedVideoAd.OnAdStarted += HandleOnAdStarted;
rewardBasedVideoAd.OnAdRewarded += HandleOnAdRewarded;
rewardBasedVideoAd.OnAdClosed += HandleOnAdClosed;
rewardBasedVideoAd.OnAdLeavingApplication += HandleOnAdLeavingApplication;
}
/*public void requestbutton(){
LoadRewardBasedAd ();
} */
public void showbutton(){
LoadRewardBasedAd ();
GameObject.Find ("VideoReward").SetActive (false);
ShowRewardBasedAd ();
rewardBasedVideoAd.OnAdRewarded += HandleOnAdRewarded;
}
private void ShowRewardBasedAd (){
if (rewardBasedVideoAd.IsLoaded ()) {
rewardBasedVideoAd.Show ();
}
else {
print ("Put any message you want here");
}
}
private void LoadRewardBasedAd(){
#if UNITY_EDITOR
string adUnitId = "unused";
#elif UNITY_ANDROID
string adUnitId = "ca-app-pub-3940256099942544/5224354917";
#elif UNITY_IPHONE
string adUnitId = "ca-app-pub-3940256099942544/1712485313";
#else
string adUnitId = "unexpected_platform";
#endif
rewardBasedVideoAd.LoadAd (new AdRequest.Builder ().Build (), adUnitId);
// rewardBasedVideoAd.LoadAd (new AdRequest.Builder ().Build (), adUnitId);
}
public void HandleOnAdLoaded(object sender,EventArgs args){
GameObject.Find ("VideoRewardLocked").SetActive (false);
//print ("done sir");
}
public void HandleOnAdFailedToLoad(object sender,AdFailedToLoadEventArgs args){
//try to load
}
public void HandleOnAdOpening(object sender,EventArgs args){
//Pause the action
}
public void HandleOnAdStarted(object sender,EventArgs args){
//mute the audio
}
public void HandleOnAdClosed(object sender,EventArgs args){
//cranck the party back up
GameObject.Find ("VideoRewardLocked").SetActive (true);
LoadRewardBasedAd ();
}
public void HandleOnAdRewarded(object sender,Reward args){
//reward the user
GameObject.Find ("VideoRewardLocked").SetActive (true);
LoadRewardBasedAd ();
PlayerPrefs.SetInt ("money", PlayerPrefs.GetInt ("money") + 100);
Application.OpenURL ("http://www.google.come");
}
public void HandleOnAdLeavingApplication(object sender,EventArgs args){
}
}