adListener error -> how to determine if it is from banner or interstitial ?

local ads = require "ads" local function adListener( event ) local msg = event.response if event.isError then end end ads.init( "iads", "myAppId", adListener )  ads.show( "banner", { x=0, y=0 } ) ads.show( "interstitial" )  

In the above code, if an error occurs, how to know if it is from the banner or the interstitial?

Hi there,

You can’t really know.

The scenario is a bit unclear. Why would you want to display both simultaneously?

Also, what you could do is launch the interstitial on the event.isError == false in the ads listener. So you would know that at the moment you fired up the interstitial, the banner is already displayed (or not, depending on your scenario), thus the interstitial display would trigger only then.

Am i making sense?

Thanks,

Alex

Your solution is not helping.

The scenario is like this (and I think it is a common one):

On the “applicationStart” event I call ads.show( “interstitial” ).

When the user goes to the play screen I call the ads.show( “banner”, { x=0, y=0 } ).

So if now I get event.isError how to know if it is from the banner (in which case I show home ads) or from the interstitial ?

There must be a way to know who causes the error!

Ok, now it makes more sense.

There is a way, we would need to expose the event source to the listener in this case. event.bannerType or similar. Would you please be so kind to file a bug report, and paste back the bug number? I’ll then update the thread as soon as this gets done.

Thanks,

Alex

I had to work around the exact same issue, but I only have one advertisement at a time. I just save the “last banner type” used so when an error occurs I can take action based on the ad type. But that is not as reliable as getting the banner type back as part of the error. Great idea for an enhancement :slight_smile:

Hi there,

You can’t really know.

The scenario is a bit unclear. Why would you want to display both simultaneously?

Also, what you could do is launch the interstitial on the event.isError == false in the ads listener. So you would know that at the moment you fired up the interstitial, the banner is already displayed (or not, depending on your scenario), thus the interstitial display would trigger only then.

Am i making sense?

Thanks,

Alex

Your solution is not helping.

The scenario is like this (and I think it is a common one):

On the “applicationStart” event I call ads.show( “interstitial” ).

When the user goes to the play screen I call the ads.show( “banner”, { x=0, y=0 } ).

So if now I get event.isError how to know if it is from the banner (in which case I show home ads) or from the interstitial ?

There must be a way to know who causes the error!

Ok, now it makes more sense.

There is a way, we would need to expose the event source to the listener in this case. event.bannerType or similar. Would you please be so kind to file a bug report, and paste back the bug number? I’ll then update the thread as soon as this gets done.

Thanks,

Alex

I had to work around the exact same issue, but I only have one advertisement at a time. I just save the “last banner type” used so when an error occurs I can take action based on the ad type. But that is not as reliable as getting the banner type back as part of the error. Great idea for an enhancement :slight_smile:

Hi Alex,

thank you for your suggestion.

But I guess this is not a bug, more of a basic feature missing.

There are a lots of fields to fill in the bug report, and also would have to make a complete project - a bit to much.

Hi Alex,

thank you for your suggestion.

But I guess this is not a bug, more of a basic feature missing.

There are a lots of fields to fill in the bug report, and also would have to make a complete project - a bit to much.