Hi Guys, I would like to know how Corona handle Admob. If I add Admob in the main.lua file the Ad will appear in all scenes. But how lua manages it in terms of of when to destroy or hide or remove? You can’t put Admob inside scene group. If I ad Admob in individual composer scene. Where will be best place to remove?
I’ve few tab pages and I would like to Add Admob in a certain pages. I’m filtering in the tab bar click handler function and show banner. But not sure where to remove or destroy to stop memory leaking…
---Main------------- function adListener( event ) if event.isError then -- Failed to receive an ad else -- loaded ad sucess end end local function showAd() ads.init( "admob", "xxxx", adListener ) ads.show( "banner", { x=0, y=myApp.statusBarHeight+1} ) end local function handleTabBarEvent( event ) local data=json.decode(loadValue('settings')) local page=event.target.\_id if data~=nil then if data.email~='' and data.password~='' and data.loggedin==true then page=page else page='account' end composer.gotoScene(page,{params = options}); else composer.gotoScene( "account",{params=options} ); composer.tabBar:setSelected(3) end if page~='account' then showAd() end return true end