iAd fullscreen - tap goes through

Seems this is a common problem in Corona, taps going thorugh when they shoudn’t (e.g. Twitter).

This one makes problem because at the place of the ad close button in my game is a close app button.

So, when I hit the close button of the ad, it closes the game.

Regards,

Damir.

I noticed the same thing when I integrated iAds.  What I did was place an invisible button underneath the iAd close button to prevent the touch event from activating anything beneath it and to inform me when the ad was dismissed.  It’s a bit cumbersome, but it works.

  • Andrew

You probably should try to capture both touch and tap events on that invisible background.   The ads come from the vendor so there is little control we have on stopping touch leaks.

Sorry Rob, not sure I understand what you mean by “capture them” ?

local catchTouchEvents = display.newRect(0,0,display.contentWidth, display.contentHeight)

catchTouchEvents.isVisibile = false

catchTouchEvents.isHitTestable = true

– insert into a group if necessary

local function doNothing()

      return true

end

catchTouchEvents:addEventListener(“touch”, doNothing)

catchTouchEvents:addEventListener(“tap”, doNothing)

ads.show(-- your ad call here --)

I was thinking about using this trick (actually I use it in many cases, e.g. for native twitter to prevent touch leaks) but I would need some event

a) adWillShow to fire just before the ad shows -> there you create that rectangle

If you create it as in your example, the app is blocked for taps until the ad is shown.

And in the doNothing function we probably would catchTouchEvents:removeSelf.

And there is another problem I posted in another thread, we can not know in the listener what is the source of the event, a banner or fullscreen.

So I would say, for now there is not a good solution for this.

I noticed the same thing when I integrated iAds.  What I did was place an invisible button underneath the iAd close button to prevent the touch event from activating anything beneath it and to inform me when the ad was dismissed.  It’s a bit cumbersome, but it works.

  • Andrew

You probably should try to capture both touch and tap events on that invisible background.   The ads come from the vendor so there is little control we have on stopping touch leaks.

Sorry Rob, not sure I understand what you mean by “capture them” ?

local catchTouchEvents = display.newRect(0,0,display.contentWidth, display.contentHeight)

catchTouchEvents.isVisibile = false

catchTouchEvents.isHitTestable = true

– insert into a group if necessary

local function doNothing()

      return true

end

catchTouchEvents:addEventListener(“touch”, doNothing)

catchTouchEvents:addEventListener(“tap”, doNothing)

ads.show(-- your ad call here --)

I was thinking about using this trick (actually I use it in many cases, e.g. for native twitter to prevent touch leaks) but I would need some event

a) adWillShow to fire just before the ad shows -> there you create that rectangle

If you create it as in your example, the app is blocked for taps until the ad is shown.

And in the doNothing function we probably would catchTouchEvents:removeSelf.

And there is another problem I posted in another thread, we can not know in the listener what is the source of the event, a banner or fullscreen.

So I would say, for now there is not a good solution for this.