superawesome.init()

Type Function
Return value none
Revision 2017.3060
Keywords ads, advertising, SuperAwesome, init
See also superawesome.load()
superawesome.show()
superawesome.*

Overview

superawesome.init() initializes the SuperAwesome plugin.

Once initialized, you can load an ad using superawesome.load() and subsequently show it via superawesome.show().

Syntax

superawesome.init( adListener, params )
adListener (required)

Listener. Listener function that will receive adsRequest events.

params (required)

Table. Table containing SuperAwesome initialization values — see the next section for details.

Parameter Reference

The params table includes initialization properties for the SuperAwesome plugin.

testMode (optional)

Boolean. Sets if test mode will be used for ads. Default is false.

Example

local superawesome = require( "plugin.superawesome" )

local function adListener( event )

    if ( event.phase == "init" ) then  -- Successful initialization
        print( event.isError )
    end
end

-- Initialize the SuperAwesome plugin
superawesome.init( adListener, { testMode=true } )