Thank you for this improvement but this still does not solve the problem of recognizing in the listener what triggered the event (the banner or the interstitial).
This is essential for implementing a fall-back strategy.
Could you further enhance it so we get a new property in the event table, identifying the source (banner or interstitial) ?
Because the interstitial is supposed to be the only thing on the screen. It’s for “in-between” things. I would hide the banner, show the interstitial, then show the banner again when ready.
ok, it isn’t really cool to reply to myself, but i fixed this. my bad, i forgot the “appId=” part inside the ads.show(“banner”), that’s why it didn’t showed up. so, i can confirm that everything works fine. but still i have another small request: can you make a way to preload admob ads? because the interstitial takes some time to show up.
There is also one big problem, that I’m surprised that so far nobody encountered it.
In Landscape mode right half of the banner ad is not clickable, so in case of Admob you can’t open ad because Download button is on right side.
I opened ticket for this issue 20 days ago (Case 26618), but nobody answered it. I can not upload my game because of this issue. Can you please take a look at it?
you have to create the to types on the admob page and then you use the appid you want to show
example:
local banner = "ca-app-pub-xxxxxxxxxxxxxxxxx/xxxxxxxxxxxx" local interstitial = "ca-app-pub-xxxxxxxxxxxxxxxxx/xxxxxxxxxxxx" function adListener( event ) if event.isError then -- Failed to receive an ad else -- loaded ad sucess end end ads.init( "admob", banner, adListener ) --fullscreen: ads.show( "interstitial", { x=display.screenOriginX, y=display.screenOriginY, appId=interstitial} ) --or banner: ads.show( "banner", { x=display.screenOriginX, y=display.screenOriginY, appId=banner} )
This worked thanks, but when an interstitial comes up, it removes the banner ad. I have it calling a new banner ad when the interstitial comes up to replace it. No way to say do it when the interstitial closes, so I just have it next line. Kind of kludgy how it all comes together.
yes, showing one hides the other. I have been using ads.hide() as well before displaying another ad. not sure if its needed or not.
One way of having some control over when to show a banner ad again after a fullscreen would be to have a timer that starts when the fullscreen ad is loaded. Say a timer of 10s and then you hide the ad incase its still up and show a banner ad.
hopefully we will get some way of knowing when a fullscreen has been closed in the future. that and the possibility of preloading a fullscreen before showing it.
you have to create the to types on the admob page and then you use the appid you want to show
example:
local banner = "ca-app-pub-xxxxxxxxxxxxxxxxx/xxxxxxxxxxxx" local interstitial = "ca-app-pub-xxxxxxxxxxxxxxxxx/xxxxxxxxxxxx" function adListener( event ) if event.isError then -- Failed to receive an ad else -- loaded ad sucess end end ads.init( "admob", banner, adListener ) --fullscreen: ads.show( "interstitial", { x=display.screenOriginX, y=display.screenOriginY, appId=interstitial} ) --or banner: ads.show( "banner", { x=display.screenOriginX, y=display.screenOriginY, appId=banner} )