Type Function Return value none Revision Release 2022.3683 Keywords ads, advertising, InMobi, init See also inMobi.load() inMobi.show() inMobi.*
inMobi.init()
initializes the InMobi plugin.
Once initialized, you can load an ad using inMobi.load() and subsequently show it via inMobi.show().
inMobi.init( adListener, params )
Listener. Listener function that will receive adsRequest events.
Table. Table containing InMobi initialization values — see the next section for details.
The params
table includes initialization properties for the InMobi plugin.
String. Your InMobi account ID. You can find this ID in the InMobi developer portal, located under your account
String. The InMobi log level you wish to use. Valid options are "debug"
or "error"
. The "debug"
log level is useful for gathering specific device IDs from the Xcode Organizer or Android monitor which can be entered into the InMobi developer portal during testing. Default behavior is no logging.
Boolean. If set to false
, InMobi will enable GDPR data collection restrictions, set to true
for opposite.
local inMobi = require( "plugin.inMobi" ) local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization print( event.isError ) end end -- Initialize the InMobi plugin inMobi.init( adListener, { accountId="YOUR_ACCOUNT_ID", logLevel="debug", hasUserConsent=true } )