I implemented Inmobi correctly with banner and interstitial. I have a problem when i call inMobi.hide, after i can’t call another time the banner inMobi with inMobi.show.
If i close the sceneA with scene:destroy( event ) and then i load another time the sceneA the inMobi don’t display banner ads, why?
— In the main:
inMobi = require “plugin.inMobi”
accountID_inMobi = " … "
banner_inMobi = " … "
fullscreen_inMobi = " … "
local function adListener_inMobi(event)
if ( event.phase == “init” ) then
– Load ad inMobi
inMobi.load( “banner”, banner_inMobi, { autoRefresh = true, width = w_banner, height = h_banner } )
elseif ( event.phase == “failed” ) then
…
end
end
inMobi.init( adListener_inMobi, { accountId=accountID_inMobi } )
— sceneA
local function showInMobi()
if ( inMobi.isLoaded( banner_inMobi ) ) then
inMobi.show( banner_inMobi, { yAlign=“bottom” } )
native.showAlert( “Load”, “Show InMobi” , { “OK”} )
else
native.showAlert( “inMobi”, "No-Load " , { “OK”} )
end
end
— when close then scene
inMobi.hide(banner_inMobi)