Type Function Return value none Revision Release 2022.3683 Keywords ads, advertising, StartApp, init See also startapp.load() startapp.*
startapp.init()
initializes the StartApp plugin.
This call is required and must be executed before making other StartApp calls.
startapp.init( listener, params )
Listener. Listener function that will receive adsRequest events.
Table. Table containing StartApp initialization values — see the next section for details.
The params
table includes parameters for the StartApp initialization.
String. The app ID for your app, gathered from the StartApp portal.
Boolean. Set this value to false to disable return ads. Default is true.
local startapp = require( "plugin.startapp" ) -- StartApp listener function local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization print( event.provider ) end end -- Initialize the StartApp plugin startapp.init( adListener, { appId="Your App ID", enableReturnAds = true } )