Integration
This page shows you how to download, configure, and initialize the AppLovin Flutter plugin.
Download the latest plugin
Download the AppLovin MAX Flutter plugin through pub.dev by entering the following dependency into your pubspec.yaml under dependencies:
⋮dependencies: applovin_max: anyYou can add that dependency to pubspec.yaml manually, or by issuing the following flutter command:
flutter pub add applovin_maxTo receive release updates, subscribe to the AppLovin MAX Flutter Plugin GitHub repository.
Install applovin_max
If you added the dependency manually (rather than with the flutter pub add command), issue the following flutter command to install applovin_max:
flutter pub get(If you add the dependency with the flutter pub add command, this step takes place automatically.)
Initialize the SDK
Import the plugin into your Dart code with this import statement:
import 'package:applovin_max/applovin_max.dart';Add the code snippet below into your app’s main home screen.
You must call AppLovinMAX.initialize() only once:
import 'package:applovin_max/applovin_max.dart';⋮MaxConfiguration? sdkConfiguration = await AppLovinMAX.initialize(«sdk-key»);
// SDK is initialized, start loading adsYou can find your SDK key in the Account > General > Keys section of the AppLovin dashboard.
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.
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.
Consent and data APIs
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.