How do i implement vungle in to corona sdk for only one scene. I followed the docs on corona site to implement vungle to my game. I implemented in only one scene of my game but it shows in every scene randomly, my question is how do i keep the vungle in only one scene.
I use also inmobi ads in game.
Here is the code i used.
I used this code in only one scene of my game.
local provider = "vungle"
local appId = "vungleTest"
local ads = require "ads"
local function adListener( event )
if event.type == "adStart" and event.isError then
-- cached video ad not available for display
end
end
ads.init( provider, appId, adListener )
local wasAdShown = ads.show( "interstitial", { isAnimated = false, isBackButtonEnabled = true } )
You didn't post all of your source so it's hard to tell the exact problem. It seems to me that you need to have some logic around the variable
wasAdShown
, also you might want to make it a global variable.I would do something like this: