So i’m getting ready to release my app to the play store and I got everything setup Google Play Services and Mobile Ads. I follow the instructions perfectly and I get NO errors. I only have one ad and its set to run every time the player completes 3 rounds in the game, however, nothing appears when I try testing it.
Something people are probably gonna ask
-
Yes it in an alpha track and my gmail is on the list of testers.
-
Yes my Ad Unit id is correct
-
Yes I am loading the ad before showing it.
-
Yes my build target is android.
if I’ve missed something important let me know, I know the code is a mess but i’ll refactor it when the ads are working ;p
//Called in start
void AdServicesSetup()
{
#if UNITY_ANDROID
string appId = "App id";
#endif
MobileAds.Initialize(appId);
mainAd = new InterstitialAd("Ad Id");
AdRequest request = new AdRequest.Builder().Build();
mainAd.LoadAd(request);
}
//Called when the round ends
public void GameEnd()
{
_gameOverPanel.SetActive(true);
_rounds++;
Social.ReportScore(_spawner.spawnedCubes, GPGSIds.leaderboard_most_cubes_stacked, success => {});
if(_rounds == 3)
{
if(mainAd.IsLoaded())
{
mainAd.Show();
_rounds = 0;
}
else
{
Debug.Log("Ad is not loaded");
}
}
_isRunning = false;
_spawner.StopSpawning();
_platform.enabled = false;
}