admob: Problem with both banner and interstitual issue

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

When changing from banner to interstitial (vice versa),  you need to always call ‘ads.init()’ again.

I don’t think they put that in the docs, but that’s what I encounter.

You should not need to re-init() each time you want to change. 

Any difference moving your your gotoScene() call in main.lua to the end?

Rob

When changing from banner to interstitial (vice versa),  you need to always call ‘ads.init()’ again.

I don’t think they put that in the docs, but that’s what I encounter.

You should not need to re-init() each time you want to change. 

Any difference moving your your gotoScene() call in main.lua to the end?

Rob