我在我的应用程序中添加了全屏广告,但是当我点击全屏广告上的十字按钮时,要关闭广告页面并同时点击广告页面以打开测试窗口,它有时会出现错误消息尝试调用方法'didRemoveListener'是一个零值,我添加了我在下面的应用程序中编写的代码,请帮助理清这个问题,谢谢...
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()
答案 0 :(得分: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