0

我在我的应用程序中添加了全屏广告,但是当我单击全屏广告上的十字按钮关闭广告页面并同时单击广告页面打开测试窗口时,有时会出现错误消息尝试调用方法'didRemoveListener ' 一个 nil 值,我在下面的应用程序中添加了我正在编写的代码,请帮助解决这个问题,谢谢...

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()
4

1 回答 1

0

一种解决方法。接受第一次接触。

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
于 2013-10-03T18:16:02.257 回答