mediaBrix.init()

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

Overview

mediaBrix.init() initializes the MediaBrix plugin.

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

Note

This call requires your MediaBrix app ID. This will be sent to you following completion of the MediaBrix registration process.

Syntax

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

Listener. Listener function that will receive adsRequest events.

params (required)

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

Parameter Reference

The params table includes parameters for MediaBrix initialization.

appId (required)

String. Your app ID from MediaBrix.

testMode (optional)

Boolean. If you wish to enable test mode, set this value to true. Default is false.

Example

local mediaBrix = require( "plugin.mediaBrix" )

local function adListener( event )

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

-- Initialize MediaBrix
mediaBrix.init( adListener, { appId="YOUR_APP_ID" } )