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!