Answer the question
In order to leave comments, you need to log in
Why aren't test ads showing?
Here is the code:
using UnityEngine;
using GoogleMobileAds.Api;
public class AdWarder : MonoBehaviour
{
private string idAd;
private string idApp;
public bool testingMode = true;
void Start()
{
Invoke("Inin", 3f);
}
void Inin()
{
#if UNITY_IPHONE
idAd = "ca-app-pub-5530031616350650/9050313142";
idApp = "ca-app-pub-5530031616350650~4969814946";
#endif
#if UNITY_ANDROID
idAd = "ca-app-pub-5530031616350650/8717488269";
idApp = "ca-app-pub-5530031616350650~1938109884";
#endif
// MobileAds.Initialize(idApp);
}
InterstitialAd ad;
public void CallIAdd()
{
Debug.Log("Call");
ad = new InterstitialAd("ca-app-pub-3940256099942544/1033173712");
AdRequest request = new AdRequest.Builder()
.AddTestDevice("8680DB4A01E89E6555855D4C9599A8D0")
.Build();
ad.LoadAd(request);
}
public void LoadAd()
{
Debug.Log("Load");
ad.Show();
}
}
Answer the question
In order to leave comments, you need to log in
ad - should contain a check - whether everything is ready and loaded.
you can't just immediately call "show ads"
in all the examples there on the update waiting or the like.
(it also requests, loads, caches .. and maybe you don’t have the Internet or block ads, so until the “baner / vidos is ready to show” flag is not there, you can’t call Show)
Update
I suggest looking here.
an example of how to wait for it to load, according to the callback, for google advertising.
https://developers.google.com/admob/unity/banner
you can also find out if there was an error and so on.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question