Closed giov507 closed 10 years ago
Have you tried calling RequestInterstitial()
when you first load your level and show it at the end? That should give you plenty of time to load the ad.
when i use requestInterstitial it loads and appear after it loads without calling it : /
That is weird... Are you sure you don't have a callback on InterstitialLoaded
?
Nope, what is the best practice?: Requesting at start then "ShowInterstitial" whenever I want? This is what I'm doing
void Start() {
admob = GetComponent<AdMobPlugin>();
admob.CreateBanner(AD_UNIT_ID, AdMobPlugin.AdSize.BANNER, false, INTERSTITIAL_ID, false);
admob.RequestAd();
admob.HideBanner();
}
void Update() { if (endgame == true){ endgame = false; admob.RequestInterstitial(); admob.ShowInterstitial(); }
Pretty much
Why don't you request the interstitial when you create the banner? You'll be able to show it when you evaluate the true branch of your if statement.
It never shows for me if I don't call ShowInterstitial(), just using RequestInterstitial() won't show it.
I wouldn't recommend requesting the interstitial immediately before you show it. Because as you noticed if can take a while before the interstitial has been downloaded to the device. In my case I use RequestInterstitial() at the start of my game round, and then call ShowInterstitial() when the player is Game Over. That way it is very likely that the interstitial has been loaded successfully before I show it.
I have also added a bool which i set to true in the interstitial callback named interstitialLoaded which I then use when I want to show the interstitial: if(admob.interstitialLoaded) { admob.ShowInterstitial(); admob.interstitialLoaded = false; }
since I rather not show it at all if it is not ready to show when I want it too. Since I dont want it popping up 10-30 seconds later.
Summary:
@DragonSpawn that was my first comment but I think @giov507 didn't understood me :(
Okay After a few tweaks it worked! Thankyou so much for your fast answers!
Showing interstitial takes a lot of time, i want it to be ready so just when i want to show it just code showinterstitial. So how to hide it?