How do I successfully implement Google Mobile Ads and Google Play Services into my Unity arcade game?

by Sam R   Last Updated February 19, 2017 01:13 AM

I have been trying for like a month now to properly implement Google Play Services and Google Mobile Ads into my Unity Android Game. I have had success in getting Google Play Services to work but when I added Google Mobile Ads at first it didn't work. I just didn't see any ads pop up. Now when I build my app it won't open it just crashes. Not exactly sure what I did. I have configured all the services correctly according to my knowledge and I'm am just using code from the documentation for the ads. Heres that code:

public static AdManager Instance { set; get; }

public string bannerId;
public string videoId;
public string deviceId;
BannerView bannerView;
InterstitialAd interstitial;

private void Start ()
{
    Instance = this;
    DontDestroyOnLoad(gameObject);
    interstitial = new InterstitialAd(videoId);
    AdRequest request = new AdRequest.Builder().AddTestDevice(deviceId).Build();
    // Load the banner with the request.
    interstitial.LoadAd(request);
}

public void ShowInterstitial()
{
    if (interstitial.IsLoaded())
        interstitial.Show();
}

I am using the correct ad Ids, I double checked that. I don't know what else to do. I can provide any other information you may need upon request.

Anyone with experience with this would be super helpful! Thanks!



Related Questions


Problem in Unity ad

Updated February 25, 2016 05:05 AM

What database to use with unity?

Updated October 03, 2017 16:13 PM


Interstitial admob libgdx

Updated March 14, 2016 08:05 AM

Leaderboard setup for Android

Updated June 22, 2016 08:05 AM