hello, implement admob a unity in the 3 types banner, interstitial and video reward that works well for me on the mobile, but my question is how I would make the video of the reward that is coin checking if the user finished watching the video or if I close it.
This is the code I am using.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GoogleMobileAds.Api;
public class LogicaAds : MonoBehaviour
{
private BannerView bannerAdd;
private InterstitialAd interstitialAd;
private RewardBasedVideoAd rewardAdd;
[SerializeField]
private string appID="";
[SerializeField]
private string bannerID="";
[SerializeField]
private string interstitialID="";
[SerializeField]
private string rewarID="";
void Start()
{
PedirInterstitial();
PedirReward();
}
private void Awake()
{
MobileAds.Initialize(appID);
}
private void PedirBanner()
{
bannerAdd = new BannerView(bannerID, AdSize.Banner, AdPosition.Bottom);
AdRequest pedir = new AdRequest.Builder().Build();
bannerAdd.LoadAd(pedir);
}
private void PedirInterstitial()
{
interstitialAd = new InterstitialAd(interstitialID);
AdRequest pedir = new AdRequest.Builder().Build();
interstitialAd.LoadAd(pedir);
}
private void PedirReward()
{
rewardAdd = RewardBasedVideoAd.Instance;
AdRequest pedir = new AdRequest.Builder().Build();
rewardAdd.LoadAd(pedir,rewarID);
}
public void CLickShowBanner()
{
PedirBanner();
}
public void ClickShowIntersticial()
{
interstitialAd.Show();
interstitialAd.Destroy();
PedirInterstitial();
}
public void ClicShowReward()
{
rewardAdd.Show();
PedirReward();
}
}