Pre loading interstitial banners on Admob.

Hello, i’m trying to preload Interstitial banners on my App, but i’m pretty sure the ads are not being preloaded, since it takes a lot of time ( 10 + seconds ) to the ads appear on a slow 3G connection.

Basically this is how i’m doing, before showing the ADS, i’m loading it via ads.load(“interstitial”), when the ADS is loaded, myData.hasADS is set to true, on the adListerner function. So when the user clicks on the button to go to another scene, i call ads.show(“interstitial”)

Here’s the code:

ads.init( "admob", myData.admobID, adListener ) -- IS CALLED on SCENE:CREATE myData.admobID, is a global variable that is set on the begging of the game based on the OS.  local function adListener( event ) -- This is above the ads.init on actual code      if ( event.isError ) then      elseif ( event.phase == "loaded" ) then                myData.hasADS = true          elseif ( event.phase == "shown" ) then -- REMOVE LOADING BACKGROUND and GO TO another scene. e          spawnTable[8]:removeSelf()          spawnTable[8] = nil          spawnTable[10]:removeSelf()          spawnTable[10] = nil          spawnTable[9]:removeSelf()          spawnTable[9] = nil          myData.contagemADS = 0          myData.hasADS = false          shouldLoadAds = false                   composer.showOverlay("resposta", parametrosResposta)      end     end  local function enableButtonClick() -- THIS is called after the button transition ends.         isButtonActive = 1         if shouldLoadAds == true then -- This is set in the begging of the scene.             if myData.hasADS == false then -- CHECK TO SEE if THERES ALREADY a AD LOADED.             ads.load("interstitial")             end         end     end local function handleButtonClick(event) if myData.hasADS == true and ads.isLoaded("interstitial") then ads.show("interstitial") else --- GO STRAIGHT TO other scene end end

Any help will be appreciated, thanks in advance! 

This is from what I notice. If you are loading the ad for the first time, it will take sometime as adMob to ‘determine the ad to show’. It will take even longer on an Android device compared to an iOS device.

@decaobr

Which device are you testing on?

I haven’t noticed any significant delays in my apps after caching an ad.  With 10 seconds, it does seem like your ads are not cached for some reason. Having said that, Android apps can take 1-2 seconds before showing a cached ad. iOS devices under a second.

I’m testing on iPhone 4S and iPad Mini, the ads are working fine when i connected to wifi or in a normal 3G connection, i’m only seem problems on really slow connections, my 3G plan works like this: i Have 50 mb of bandwidth to use everyday at 2 MG connection, after using this 50mb bandwidth, my speed is reduced to 32kbs, when this happen i get the delays. 

OK, I have a theory of what might be going on.

When displaying an ad (although cached) it still needs to contact Google’s AdMob servers to tell it that an impression is happening. In that process data needs to be sent back and forth between the device and AdMob server. Even though that data volume may be small, it will still take time over a very slow connection.

Well since everything is ok in my code, i’m going to be releasing the app without changing anything, honestly i don’t think this problem will be affecting a lot of users.

Thanks for the help!

I seem to have spent most of a day tinkering around with this trying to get it to work. This was the best I came up with http://forums.coronalabs.com/topic/51785-adsisloaded-becomes-false-after-being-loaded-successfully/ - the second post has a button that goes red/green depending on the loading state and displays the interstitial.

This is from what I notice. If you are loading the ad for the first time, it will take sometime as adMob to ‘determine the ad to show’. It will take even longer on an Android device compared to an iOS device.

@decaobr

Which device are you testing on?

I haven’t noticed any significant delays in my apps after caching an ad.  With 10 seconds, it does seem like your ads are not cached for some reason. Having said that, Android apps can take 1-2 seconds before showing a cached ad. iOS devices under a second.

I’m testing on iPhone 4S and iPad Mini, the ads are working fine when i connected to wifi or in a normal 3G connection, i’m only seem problems on really slow connections, my 3G plan works like this: i Have 50 mb of bandwidth to use everyday at 2 MG connection, after using this 50mb bandwidth, my speed is reduced to 32kbs, when this happen i get the delays. 

OK, I have a theory of what might be going on.

When displaying an ad (although cached) it still needs to contact Google’s AdMob servers to tell it that an impression is happening. In that process data needs to be sent back and forth between the device and AdMob server. Even though that data volume may be small, it will still take time over a very slow connection.

Well since everything is ok in my code, i’m going to be releasing the app without changing anything, honestly i don’t think this problem will be affecting a lot of users.

Thanks for the help!

I seem to have spent most of a day tinkering around with this trying to get it to work. This was the best I came up with http://forums.coronalabs.com/topic/51785-adsisloaded-becomes-false-after-being-loaded-successfully/ - the second post has a button that goes red/green depending on the loading state and displays the interstitial.