So I have 3 different scenes ( start.lua, game.lua, restart.lua )
Here is my main.lua
[lua]display.setStatusBar ( display.HiddenStatusBar )
local storyboard = require (“storyboard”)
storyboard.gotoScene(“start”)
local ads = require (“ads”)
local bannerAppID = “ca-app-pub-xxxxxxxxxxxxxxxxxxxxxxxxxxxx”
local interstitialAppID = “ca-app-pub-xxxxxxxxxxxxxxxxxxxxxxxxxxxx”
local adProvider = “admob”
local function adListener (event)
ads.height()
end
local appId = interstitialAppID
if not interstitialAppID then
appId = bannerAppID
end
ads.init( adProvider, appId, adListener )[/lua]
I have my ads.show in all 3 scenes.
in --function scene:enterScene( event )–
[lua]–start.lua
function scene:enterScene( event )
ads.show (“interstitial”, {appId = interstitialAppID})
end[/lua]
[lua]–game.lua
function scene:enterScene( event )
ads.show (“banner”, {x=0, y=10000, appId=bannerAppID})
end[/lua]
[lua]–restart.lua
function scene:enterScene( event )
ads.show (“interstitial”, {appId = interstitialAppID})
end[/lua]
When I built in Xcode simulator, all ads work perfectly fine.
They showed when enter scenes.
However, when I built for the device and installed into my iPhone
It only shows either banner or interstitial.
When the appId in main.lua = bannerAppID, it only shows banner.
When the appId in main.lua = interstitialAppID, it only shows interstitial.
What should I change to show all ads perfectly in my device