0

I have added full screen Ads in my application but when i click on the cross button on the full screen Ads to close the Ads page and simultaneously click on the Ads Page to open the test window it sometimes gives error message attempt to call method 'didRemoveListener' a nil value, i have added code what i am writing in my application below, Please help to sort out this problem, thanks...

local RevMob = require("revmob")
display.setStatusBar(display.HiddenStatusBar)

local fullscreen
local revmobListener

local storyboard = require "storyboard"    
local REVMOB_IDS = { 
    ["Android"] = "",
    ["iPhone OS"] = ""
}

RevMob.startSession(REVMOB_IDS)
RevMob.setTestingMode(RevMob.TEST_WITH_ADS)

local function ShowAds()
    fullscreen.RevMob.createFullscreen()
    RevMob.showFullscreen(revmobListener, REVMOB_IDS)
end

revmobListener=function(event)
if(event.type=="adClicked" then
    fullscreen:hide()
    storyboard.gotoScene("scenes.Scene1")
elseif event.type=="adClosed" then
    fullscreen:hide()
    storyboard.gotoScene("scenes.Scene1")
end

ShowAds()
Kamiccolo
  • 7,758
  • 3
  • 34
  • 47
user2588337
  • 71
  • 1
  • 12
  • The easiest thing to do is remove multitouch when you show full banners. – Bruno Domingues Oct 03 '13 at 15:43
  • Can you give me example of how to remove this multitouch because i have never done it before, and one thing more the error is displayed only when i click on the ad full screen banner to display ad in the browser for testing and click on the cross button of full screen Ads – user2588337 Oct 03 '13 at 15:46
  • You just need to call this function system.deactivate("multitouch"), if you want to activate again you call system.activate("multitouch"). I think that's a bug in the revmob sdk. – Bruno Domingues Oct 03 '13 at 16:50
  • It did'nt solve my problem. I think there must be some other way to do that, thanks for your suggestion – user2588337 Oct 03 '13 at 17:26

1 Answers1

0

A way to solve it. Just accept the first touch.

local clicked = false
revmobListener=function(event)
if(event.type=="adClicked" and not clicked then
    fullscreen:hide()
    storyboard.gotoScene("scenes.Scene1")
    clicked = true
elseif event.type=="adClosed" and not clicked then
    fullscreen:hide()
    storyboard.gotoScene("scenes.Scene1")
    clicked = true
end
Bruno Domingues
  • 1,017
  • 9
  • 12
  • It did'nt work, because the fullscreen Ads works irrespective of whether i implement revmobListener or not, the same problem is there while implementing the above code... – user2588337 Oct 04 '13 at 17:04