2013-10-03 57 views
0

我在應用程序中添加了全屏廣告,但是當我點擊全屏上的十字按鈕廣告關閉廣告頁面並同時點擊廣告頁面打開測試窗口有時會給出錯誤信息試圖調用方法「didRemoveListener」一個零值,我已經添加的代碼是什麼我寫在下面我的應用程序,請幫助理清這個問題,謝謝...在Corona中添加Revmob全屏廣告時發生的問題

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

您能否舉例說明如何刪除此多點觸控,因爲我之前從未做過這種操作,而且只有當我點擊廣告全屏橫幅才能在瀏覽器中顯示廣告進行測試時,纔會顯示一個錯誤,並單擊全屏廣告按鈕 – user2588337

+0

您只需要調用此函數system.deactivate(「multitouch」),如果您想再次激活,請致電system.activate(「multitouch」)。我認爲這是revmob sdk中的一個錯誤。 –

回答

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 
+0

它沒有工作,因爲無論我是否實現revmobListener,全屏廣告都能正常工作,在執行上述代碼時也存在同樣的問題... – user2588337