In my unity editor when I'm playing it shows me that the ad's have successfully loaded, etc.
However when I build the game and play it on my device no ads seem to show and on Bluestacks the game crashes whenever I load the scene which has the interstitial ads in it.
using UnityEngine;
using GoogleMobileAds.Api;
public class InterstitialAdvert : MonoBehaviour
{
public static InterstitialAdvert manager;
private InterstitialAd interstitial;
void Awake()
{
manager = this;
RequestInterstitial();
}
private void RequestInterstitial()
{
#if UNITY_ANDROID
string adUnitId = "ca-app-pub-6101605888755494/3301497967";
#elif UNITY_IPHONE
string adUnitId = "INSERT_IOS_INTERSTITIAL_AD_UNIT_ID_HERE";
#else
string adUnitId = "unexpected_platform";
#endif
// Initialize an InterstitialAd.
InterstitialAd interstitial = new InterstitialAd(adUnitId);
// Create an empty ad request.
AdRequest request = new AdRequest.Builder().Build();
// Load the interstitial with the request.
interstitial.LoadAd(request);
}
public void GameOver()
{
if (interstitial.IsLoaded())
{
interstitial.Show();
}
}
}
If you need any more information please just ask.