2016-09-16 2 views
1

탭 버튼이 발생할 때 삽입 광고를 게재하는 순간에 나는 코로나 (LUA)에 관한 질문이 있습니다.) 모든 응용 프로그램에 (매 20 개 도청 :이 그 작업을 (때로는로드 5-10-15 초처럼 소요 및 광고, 난 이유를 잘 모릅니다 :코로나 삽입 광고 탭 수

local ads = require("ads") 
local interstitialAppID = "ca-app-pub-xxxxxxxxxx/xxxxxxxx21" 
local testMode = true 

local adProvider = "admob" 
local function adListener(event) 

if (event.isError) then 
    print ("Error en el anuncio!", msg) 

elseif (event.phase == "loaded") then 
    print ("Anuncio cargado!", msg) 

elseif (event.phase == "shown") then 
    print ("Cargando nuevo anuncio!", msg) 
    ads.load ("interstitial", { appId = interstitialAppID, testMode = isTestMode }) 
end 
end 

ads.init("admob", interstitialAppID, adListener) 
ads.load ("interstitial", { appId = interstitialAppID, testMode = isTestMode }) 

-- INTERSTITIAL AD 
local function Adinterstatial(self, event) 
ads.show("interstitial", { appId = interstitialAppID, testMode = isTestMode 
}) 
end  

local test = display.newImageRect("Lore/0.png", 50, 50) 
test.x = 150 
test.y = 150 
test.tap = Adinterstatial 
test:addEventListener("tap") 

내가 예를 들어이 작업을 수행 할 수 interistitial 광고를 보여줍니다. 내가 그것을 할 수있는 방법이 가능? 인가?

이 감사합니다.

답변

0

당신은 Runtime 탭 이벤트를 추가 할 수 있습니다.이 화면에 모든 탭을 얻을 것이다, 그것은 문제가되지 않는 경우 또는 어떤 객체가 탭되었는지 예 :

local numTaps = 0 
local function countTaps() 
    numTaps = numTaps + 1 
    if numTaps % 20 == 0 then 
     -- Show the add here. 
    end 
end 

Runtime:addEventListener("tap", countTaps) 

%은과 20 사이의 나머지 부분을 가져옵니다. 즉, 20 회 탭마다 0이됩니다.