Test ads won't show up on my Android Device I have the Google play services and the Google Repository installed with sdk manager and here is my
I don't get any errors it just doesn't display the test ads. What am I missing? please help.
here is my AdManager script->
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GoogleMobileAds.Api;
using System;
public class AdManager : MonoBehaviour
{
private InterstitialAd interstitial;
private string adUnitId, appid;
[Obsolete]
public void Start()
{
appid = "ca-app-pub-*****************";
adUnitId = "ca-app-pub-3940256099942544/1033173712";
MobileAds.Initialize(appid);
RequestInterstitial();
}
public void RequestInterstitial()
{
// Initialize an InterstitialAd.
this.interstitial = new InterstitialAd(adUnitId);
// Create an empty ad request.
AdRequest request = AdRequestBuild();
// Load the interstitial with the request.
this.interstitial.LoadAd(request);
this.interstitial.OnAdLoaded += HandleOnAdLoaded;
// Called when an ad request failed to load.
this.interstitial.OnAdFailedToLoad += HandleOnAdFailedToLoad;
// Called when an ad is shown.
this.interstitial.OnAdOpening += HandleOnAdOpened;
// Called when the ad is closed.
this.interstitial.OnAdClosed += HandleOnAdClosed;
// Called when the ad click caused the user to leave the application.
this.interstitial.OnAdLeavingApplication += HandleOnAdLeavingApplication;
}
private void HandleOnAdLeavingApplication(object sender, EventArgs e)
{
throw new NotImplementedException();
}
public void HandleOnAdLoaded(object sender, EventArgs args)
{
MonoBehaviour.print("HandleAdLoaded event received");
}
public void HandleOnAdFailedToLoad(object sender, AdFailedToLoadEventArgs args)
{
MonoBehaviour.print("HandleFailedToReceiveAd event received with message: "
+ args.Message);
}
public void HandleOnAdOpened(object sender, EventArgs args)
{
MonoBehaviour.print("HandleAdOpened event received");
}
public void HandleOnAdClosed(object sender, EventArgs args)
{
MonoBehaviour.print("HandleAdClosed event received");
}
public void interstitial_Show()
{
if (this.interstitial.IsLoaded())
{
this.interstitial.Show();
}
else
{
Debug.Log("error");
}
}
AdRequest AdRequestBuild()
{
return new AdRequest.Builder().Build();
}
}
when I build my app after force resolve it gives me some error, which I attach with mail.