Skip to content

Integration

This section shows you how to download, configure, and initialize the AppLovin MAX Defold Plugin.

Download the Latest Plugin

To download and import the AppLovin MAX Defold Plugin into your project, follow these steps:

  1. Find the latest version of the plugin from the list of available Releases.
  2. Copy the URL to the ZIP archive of the release. Add it to your game.project dependencies.
    [project]
    dependencies#0 = https://url.to.latest.version/release.zip
  3. Select Project > Fetch Libraries to download the plugin and make it available in your project.
  4. Add /extension-applovin/res/ios to your game.project bundle resources.
    [project]
    bundle_resources = /extension-applovin/res/ios
    dependencies#0 = https://url.to.latest.version/release.zip

To receive release updates, subscribe to the AppLovin MAX Defold Plugin GitHub repository.

Initialize the SDK

Declare and set a callback function to receive SDK events from the SDK. Then initialize the SDK as soon as your app launches, as in the code sample below.

Users have a better experience if mediated networks cache their ad assets. For this reason, always initialize the AppLovin SDK on startup. This gives mediated networks time to cache ads. This is especially important with video ads.

local function applovin_callback(self, name, params)
if name == "OnSdkInitializedEvent" then
-- AppLovin SDK is initialized, start loading ads
end
function init(self)
applovin.set_callback(applovin_callback)
applovin.initialize("«your-SDK-key»")
end

You can find your SDK key in the Account > General > Keys section of the AppLovin dashboard.

iOS 14 Support

In iOS 14, Apple introduced global privacy policy changes. Apple requires applications to comply with these new policies. If you fail to comply, you may lose revenue. This section explains how to comply.

SKAdNetwork

Update your app’s Info.plist with network-specific identifiers. See the SKAdNetwork documentation for instructions.

You must get consent from your users in certain jurisdictions on behalf of AppLovin’s monetization partners. You must also pass consent values to AppLovin. To learn how, review the Privacy–Consent, Age-Related Flags, and Data APIs documentation.