Ads.show takes 10 seconds on wifi

Hi,

I have 3 scenes in my game - menu, game, and game over.  I show ads in menu and gameover.  I have to call ads.show() in menu and gameover, and then ads.hide() in both as well when the user goes to the game scene.  Unfortunately this process takes a good 8-10 seconds each time.  Nobody’s going to see the banner ad on the game over page because it takes 8 seconds to load.

I feel like I must be doing something wrong.  Why is it not caching the ad so it can show it immediately?  I think it’s trying to load a new on each time or something like that.

As for the environment, I’m using adMob on a Huawei Android phone running Android 4.0.*.  

To show the ads I write in introscene.lua:

[lua]

function scene:show( event )

  if (event.phase == “will” and shown == false) then

    …

    newAd = ads.show( “banner”, { x=0, y=h, appId=bannerAppID } );

    local adHeight = ads.height();

[/lua]

To hide it I write also in introscene.lua:

[lua]

function scene:hide(event)

  if ( event.phase == “will” ) then

    ads.hide();

  end

end

[/lua]

It correctly hides ads at scene transition out.  Unfortunately it takes 8-10 seconds to load the ad initially (I counted, that’s not just a frustrated guesstimate).  If you have any ideas what to do I would appreciate it.

Thanks!

Hi @hdtruelson,

Please provide more details on this issue. At the very minimum, you need to tell the community/staff which ad provider you’re attempting to use. Then, I suggest that you show the code you’re using to both load and show the ad, but if possible, do not paste an entire Composer scene (or multiple scenes) into a forum post, since that also becomes overwhelming to read through. It’s best if you can isolate your code down to the most minimum example so others can assist you.

Also, remember the surround the code with “lua” tags for clarity:

[lua] -- your code [/lua]

Best regards,

Brent

Hi Brent,

Sorry for not giving that information.  I have updated my post accordingly

Hi @hdtruelson,

Please provide more details on this issue. At the very minimum, you need to tell the community/staff which ad provider you’re attempting to use. Then, I suggest that you show the code you’re using to both load and show the ad, but if possible, do not paste an entire Composer scene (or multiple scenes) into a forum post, since that also becomes overwhelming to read through. It’s best if you can isolate your code down to the most minimum example so others can assist you.

Also, remember the surround the code with “lua” tags for clarity:

[lua] -- your code [/lua]

Best regards,

Brent

Hi Brent,

Sorry for not giving that information.  I have updated my post accordingly