Type Function Return value none Revision 2017.3060 Keywords ads, advertising, Supersonic, init See also supersonic.load() supersonic.show() supersonic.*
supersonic.init()
initializes the Supersonic plugin.
Once initialized, you can load an ad using supersonic.load() and subsequently show it via supersonic.show().
supersonic.init( adListener, params )
Listener. Listener function that will receive adsRequest events.
Table. Table containing Supersonic initialization values — see the next section for details.
The params
table includes initialization properties for the Supersonic plugin.
String. Your Supersonic app key, retrieved from the Supersonic developer portal.
local supersonic = require( "plugin.supersonic" ) local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization print( event.isError ) end end -- Initialize the Supersonic plugin supersonic.init( adListener, { appKey="YOUR_APP_KEY" } )