Best way to hide/unhide and position ads?

In my app I’m trying to show ads on most screens, but in a few, I need to hide them (for purposes of space).

I am having a bit of trouble, everything works fine until after I call ads.hide().

I have a flag variable, and on every scene that should have ads it checks the flag and if not showing ads then I call ads.show(), but the ads never come back up once I hide them. I cannot seem to find anyone who has an example of doing something like this.

I read one person moves the ads off screen and then back on, avoiding ads.hide() altogether, but is this the only way? And does it violate ads TOS?

Also, any input on placing ads at the bottom of the screen in portrait mode would be helpful. I am using inmobi right now, since inneractive is now in violation of iOS TOS, but I’m open to opinions on that too. My app will be going out on Android, Kindle, and iOS.

Thanks in advance for any help!

Anyone have any ideas?

+1

Are you calling ad.show() with all the required parameters? 

Are you sure your not running into an inventory problem?  Many ad providers simply don’t have enough paid ads to always deliver one too you (and frequently you get more no ads to real ads).  I don’t know why they don’t provide remnant ads to at least fill the space.

in main 

--load ads ads = require "ads"; adsFlag = false; local function adListener( event ) if event.isError then -- Failed to receive an ad. print("Ad failed"); end end --initialize ads local platformName = system.getInfo("platformName") if platformName == "iPhone OS" then ads.init("inmobi", "key", adListener); --load ads banner ads.show( "banner320x48", { x=0, y=(display.contentHeight - 38), interval=60, testMode=true } ); adsFlag=true; elseif platformName == "Android" then ads.init("inmobi", "key", adListener); --load ads banner ads.show( "banner320x48", { x=0, y=(display.contentHeight - 38), interval=60, testMode=true } ); adsFlag=true; end

On most scenes:

if (adsFlag == false) then ads.show( "banner320x48", { x=0, y=(display.contentHeight - 38), interval=60, testMode=true } ); adsFlag = true; end

On 2 scenes theres something like this:

if parameter \> 3 then ads.hide(); adsFlag=false; else if (adsFlag == false) then ads.show( "banner320x48", { x=0, y=(display.contentHeight - 40), interval=60, testMode=true } ); adsFlag=true; end end

I have tried this with inneractive and inmobi. as you can see with inmobi i am in test mode so the ad should appear. What is happening is the ads load fine when game starts, they hide fine based on the if condition, but after i hide them they never return. 

Side note, on iOS if i click the ad, then go back in the game the status bar is no longer hidden. Odd

Anyone have any ideas?

+1

Are you calling ad.show() with all the required parameters? 

Are you sure your not running into an inventory problem?  Many ad providers simply don’t have enough paid ads to always deliver one too you (and frequently you get more no ads to real ads).  I don’t know why they don’t provide remnant ads to at least fill the space.

in main 

--load ads ads = require "ads"; adsFlag = false; local function adListener( event ) if event.isError then -- Failed to receive an ad. print("Ad failed"); end end --initialize ads local platformName = system.getInfo("platformName") if platformName == "iPhone OS" then ads.init("inmobi", "key", adListener); --load ads banner ads.show( "banner320x48", { x=0, y=(display.contentHeight - 38), interval=60, testMode=true } ); adsFlag=true; elseif platformName == "Android" then ads.init("inmobi", "key", adListener); --load ads banner ads.show( "banner320x48", { x=0, y=(display.contentHeight - 38), interval=60, testMode=true } ); adsFlag=true; end

On most scenes:

if (adsFlag == false) then ads.show( "banner320x48", { x=0, y=(display.contentHeight - 38), interval=60, testMode=true } ); adsFlag = true; end

On 2 scenes theres something like this:

if parameter \> 3 then ads.hide(); adsFlag=false; else if (adsFlag == false) then ads.show( "banner320x48", { x=0, y=(display.contentHeight - 40), interval=60, testMode=true } ); adsFlag=true; end end

I have tried this with inneractive and inmobi. as you can see with inmobi i am in test mode so the ad should appear. What is happening is the ads load fine when game starts, they hide fine based on the if condition, but after i hide them they never return. 

Side note, on iOS if i click the ad, then go back in the game the status bar is no longer hidden. Odd

I’m having the same problem.  Inneractive will load an ad right away.  If I leave it alone, I will see 3 or 4 more ads.  As soon as I hide an ad and then try to show it again, using the same  show() params as before, the ads never come back.

I’m having the same problem.  Inneractive will load an ad right away.  If I leave it alone, I will see 3 or 4 more ads.  As soon as I hide an ad and then try to show it again, using the same  show() params as before, the ads never come back.