3

I am adding AdMob Interstitial adds to my Android Cordova app. I preload the ad with this call during a natural break in the game:

if(AdMob) AdMob.prepareInterstitial( {adId:admobid.interstitial, autoShow:false} ); 

But, if the user navigates to the next screen and replays the game, and the ad is still pre-loading in the background, it obviously affects the performance of the app. My app is about exact timing, so this ruins the game.

So, I would like to cancel the pre-load or dispose of it somehow, but I do not see this sort of option in the AdMob API. Another option would be to prevent the player from navigating to the next screen until a certain amount of time has passed, but there is no timeout option for AdMob preload either.

The exact plugin I am using is 'cordova-plugin-admobpro': https://github.com/floatinghotpot/cordova-admob-pro

learnworkplay
  • 633
  • 6
  • 10
  • Which plugin are you using? And why don't you prepare the interstitial ahead of time? – MegaAppBear Oct 09 '15 at 00:00
  • I am using the latest 'cordova-plugin-admobpro'. I'm not sure where else I could prepare ahead of time. From what I have read, I am supposed to call Admob.prepareInterstitial each time I want to serve up a new add. As mentioned, I can't have it preloading while the game is playing as it negatively affects performance. So I call the preload function after each round on the round summary screen. The amount of time it takes to preload is indeterminant, so how can I assure no preloading is happening during gameplay? – learnworkplay Oct 09 '15 at 00:12

1 Answers1

2

I am using https://github.com/appfeel/admob-google-cordova

From their docs

If you already called admob.requestInterstitialAd() but the interstitial has never been shown, the following calls to admob.requestInterstitialAd() will result in the ad being inmediately available (the one that was obtained in the first call).

One of my apps is a puzzle game, it takes players on average 30 seconds per puzzle. I load the interstitial on loading the puzzle, and display just after the win screen when the user clicks "Next" to load the next puzzle.

FYI, I am using a minimum threshold time between display one interstitial and the next so it's not shown after every win.

MegaAppBear
  • 1,220
  • 1
  • 9
  • 11