Hi there!
I try to show ads by admob, and test show works, but not real. It throws OnAdFailedToLoad event with message “No fill”. What is wrong ?
Here how i prepare ads
public void PrepareInterstitialAdMob()
{
Debug.Log("PrepareInterstitialAdMob");
interstitial = new InterstitialAd(AdMobInterstitialBlockID);
// Called when an ad request has successfully loaded.
interstitial.OnAdLoaded += HandleOnAdLoaded;
// Called when an ad request failed to load.
interstitial.OnAdFailedToLoad += HandleOnAdFailedToLoad;
// Called when an ad is shown.
interstitial.OnAdOpening += HandleOnAdOpened;
// Called when the ad is closed.
interstitial.OnAdClosed += HandleOnAdClosed;
// Called when the ad click caused the user to leave the application.
interstitial.OnAdLeavingApplication += HandleOnAdLeavingApplication;
AdRequest request;
if (Debug.isDebugBuild)
{
request = new AdRequest.Builder()
.AddTestDevice(TestDeviceID)
.Build();
}
else
{
request = new AdRequest.Builder()
.Build();
}
interstitial.LoadAd(request);
}
And then show
private IEnumerator<float> ShowInterstitialAdMob()
{
if (interstitial == null)
{
Debug.Log("ShowInterstitialAdMob, interstitial == null");
PrepareInterstitialAdMob();
}
while (!interstitial.IsLoaded())
{
yield return Timing.WaitForOneFrame;
}
interstitial.Show();
if (Debug.isDebugBuild)
Debug.Log("====SHOW ADMOB INTERSTITIAL====");
EventManager.TriggerEvent("AdsIsLoadedAndShow");
}