Type Function Return value none Revision Release 2024.3703 Keywords ads, advertising, MediaBrix, init See also mediaBrix.load() mediaBrix.show() mediaBrix.*
mediaBrix.init()
initializes the MediaBrix plugin.
Once initialized, you can load an ad using mediaBrix.load() and subsequently show it via mediaBrix.show().
This call requires your MediaBrix app ID. This will be sent to you following completion of the MediaBrix registration process.
mediaBrix.init( adListener, params )
Listener. Listener function that will receive adsRequest events.
Table. Table containing MediaBrix initialization values — see the next section for details.
The params
table includes parameters for MediaBrix initialization.
String. Your app ID from MediaBrix.
Boolean. If you wish to enable test mode, set this value to true
. Default is false
.
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" } )