Unity, InterstitialAd, failed to load - Internal error

360 views
Skip to first unread message

Chaz Ashley

unread,
Sep 18, 2016, 7:13:53 AM9/18/16
to Google Mobile Ads SDK Developers
Hallo guys.
I use Unity 5.4.0p2 and Google Mobile Ads Unity Plugin v3.0.6.

At first I checked the Banner ad and it worked perfectly. Then I tried Interstitial ad and it does not work.

I took the code from tutorial and now I have only one script in my project

using UnityEngine;
using GoogleMobileAds.Api;

public class AdMobTest : MonoBehaviour {

    InterstitialAd interstitial;

    void Start()
    {
        RequestBanner();
    }

    private void RequestBanner()
    {
#if UNITY_ANDROID
        string adUnitId = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
#elif UNITY_IPHONE
        string adUnitId = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
#else
        string adUnitId = "unexpected_platform";
#endif

        // Create a 320x50 banner at the top of the screen.
        interstitial = new InterstitialAd(adUnitId);
        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();
        // Load the banner with the request.
        interstitial.LoadAd(request);
        interstitial.OnAdLoaded += ShowAd;
        interstitial.OnAdFailedToLoad += FailedToLoad;

    }

    private void FailedToLoad(object sender, AdFailedToLoadEventArgs e)
    {
        Debug.Log("failed to load: " + e.Message);
    }

    void ShowAd(object sender, System.EventArgs args)
    {
        Debug.Log("loaded");
        interstitial.Show();
    }
}

In log I can see this failed to load: Internal error

So how do I fix it? 

Chaz Ashley

unread,
Sep 18, 2016, 9:09:10 AM9/18/16
to Google Mobile Ads SDK Developers
Now it works! I just takes some time before this kind of ads is ready to use. (about few hours)
Reply all
Reply to author
Forward
0 new messages