I have discovered a strange bug with admob banner ads on iOS. I have not tried it on Android.
In my app I have several screens and some of them have a banner ad and some do not.
This is my code to show:
[lua]A.showTop = function()
if not validateNoAd() then
if (system.getInfo(“platformName”) == “Android”) then
ads:setCurrentProvider( “admob” )
if store.target == “amazon” then
ads.show(“banner”, {[“x”]=0, [“y”]=0, appId = amazonAdmobID})
else
ads.show(“banner”, {[“x”]=0, [“y”]=0, appId = googleAdmobID})
end
else
ads:setCurrentProvider( “iads” )
ads.show(“banner”, {[“x”]=0, [“y”]=0})
end
return true
end
end[/lua]
This is my code to hide:
[lua]ads.hide()[/lua]
So, pretty straight forward implementation.
Here is what I am seeing. It works as you would hope based on the above code until you minimize the app. If you minimize the app while an android ad is showing, then bring it back up, the android ad that had been displaying gets stuck in memory. The ads appear to cycle normally with navigation until I call ads.hide() then the active ad disappears and the jammed ad appears.
This is mainly a problem because it is showing an ad on a page where ads were removed due to space constraints, in my case it’s over the “close window” button since it is at the top. This jammed ad has no click effect, I can click through it and push the “close window” button.
Any advice on how to work around this bug? I’m almost ready to ship and this is holding me up.