Type Function Return value none Revision Release 2025.3721 Keywords ads, advertising, AppLovin, Applovin Max, init See also applovinMax.load() applovinMax.show() applovinMax.*
applovinMax.init() initializes the AppLovin plugin.
Once initialized, you can load an ad using applovinMax.load() and subsequently show it via applovinMax.show().
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.
applovin.init( adListener, params )
Listener. Listener function that will receive adsRequest events.
Table. Table containing AppLovin initialization values — see the next section for details.
The params table includes parameters for the AppLovin initialization.
Boolean. Set this to true to output AppLovin logs to the console.
String. You can manually set sdkKey
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.
local applovinMax = require( "plugin.applovinMax" )
local function adListener( event )
if ( event.phase == "init" ) then -- Successful initialization
print( event.isError )
end
end
-- Choose sdkKey depending on platform
local sdkKey
if system.getInfo("platform") == "android" then
sdkKey = "YOUR_ANDROID_SDK_KEY"
elseif system.getInfo("platform") == "ios" then
sdkKey = "YOUR_IOS_SDK_KEY"
else
sdkKey = "" -- fallback (unsupported)
end
-- Initialize the AppLovin plugin
applovinMax.init( adListener, { testMode=true, sdkKey = sdkKey } )