Type Function Return value none Revision Release 2025.3721 Keywords ads, advertising, Vungle See also vungle.load() vungle.show() vungle.*
vungle.init() initializes the Vungle plugin. This call is required and must be executed before making other Vungle calls such as vungle.load() or vungle.show().
vungle.init( appID [, adListener] )
String. The App ID for your app, gathered from the Vungle dashboard.
Listener. The function or table that will handle adsRequest lifecycle events from the Vungle plugin.
local vungle = require( "plugin.vungle.v6" )
local appID
if ( system.getInfo("platform") == "android" ) then
appID = "YOUR_ANDROID_APP_ID"
else
appID = "YOUR_IOS_APP_ID"
end
-- Vungle listener function
local function adListener( event )
if ( event.phase == "init" ) then -- Successful initialization
print( event.provider )
end
end
-- Initialize the Vungle plugin
vungle.init( appID, adListener )