applovin.init()

Type Function
Return value none
Revision Release 2022.3683
Keywords ads, advertising, AppLovin, Applovin Max, init
See also applovinMax.load()
applovinMax.show()
applovinMax.*

Overview

applovinMax.init() initializes the AppLovin plugin.

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

Note

This call requires your AppLovin SDK key, obtained from the AppLovin developer portal. From the Account section, expand the Account menu on the left side, select Keys, and your SDK key should be revealed.

Syntax

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

Listener. Listener function that will receive adsRequest events.

params (required)

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

Parameter Reference

The params table includes parameters for the AppLovin initialization.

verboseLogging (optional)

Boolean. Set this to true to output AppLovin logs to the console.

testMode (optional)

Boolean. Set this to true to enable test mode. When true, test mode will take immediate effect and this will override the test mode setting in the AppLovin developer portal.

Example

local applovinMax = require( "plugin.applovinMax" )

local function adListener( event )

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

-- Initialize the AppLovin plugin
applovinMax.init( adListener, { testMode=true } )