Hi guys 
I am just finishing my first game and it tends to crash when calling “ads.show” at my level.lua after gameOver:
level.lua
-- scene:show() ads:setCurrentProvider( "vungle" ) function gameOver() ads.show( "interstitial", { isAnimated = false, isAutoRotation = true } ) end
In order to prevent this can you please give me few advices (best practices):
-
Should I make “ads” a global variable (i.e. reachable for all composer scenes) or call it locally in every single scene like this?
local ads = require “ads”
-
Where should I create ads listener functions, where should I “setCurrentProviders” ?
Obviously I have three options: create it at top level code, at scene:create or scene:show?
- Is there a need to display.remove and nil “ads” variable when changing scenes (at scene:hide section)?
Waiting your reply!
Many thanks! 
Ivan