Flutter SDK Integration
Integrating the SDK
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: any
You can add that dependency to pubspec.yaml manually, or by issuing the following flutter command:
flutter pub add 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
iOS 14 Support
SKAdNetwork
Update app's Info.plist with network-specific identifiers.
- A
GADApplicationIdentifier
key with a string value of your AdMob app ID. - A
SKAdNetworkItems
key with SKAdNetworkIdentifier values. - You can find SKAdNetwork values here. Copy and paste all of these into your Info.plist file.
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:
import 'package:applovin_max/applovin_max.dart';⋮MaxConfiguration? sdkConfiguration = await AppLovinMAX.initialize(<var>LViME7X7lxKv-i-F_7zqiS5mftIkLozQDU3EVbAPn80KLVP7ImNA15ows7wdxZeVHHT-R_lIJO9TwH5bAxm7_N</var>);// SDK is initialized, start loading ads
Enable Creative Debugger
AppLovinMAX.setCreativeDebuggerEnabled(true);
Integrating Mediation Networks
Android
Add maven repositories url for the mediations networks to you project level build.gradle file.
Groovy
repositories {google()mavenCentral()maven { url "https://cboost.jfrog.io/artifactory/chartboost-ads/" }maven { url "https://android-sdk.is.com" }maven { url "https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea" }maven { url "https://artifact.bytedance.com/repository/pangle" }maven { url "https://s3.amazonaws.com/smaato-sdk-releases/" }maven { url "https://repo.pubmatic.com/artifactory/public-repos" }maven { url "https://ysonetwork.s3.eu-west-3.amazonaws.com/sdk/android" }}
Kotlin DSL
repositories {google()mavenCentral()maven { url = uri("https://cboost.jfrog.io/artifactory/chartboost-ads/") }maven { url = uri("https://android-sdk.is.com") }maven { url = uri("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea") }maven { url = uri("https://artifact.bytedance.com/repository/pangle") }maven { url = uri("https://s3.amazonaws.com/smaato-sdk-releases/") }maven { url = uri("https://ysonetwork.s3.eu-west-3.amazonaws.com/sdk/android") }maven { url = uri("https://repo.pubmatic.com/artifactory/public-repos") }}
Add following dependencies for mediation networks in app.level build.gradle file:
Groovy
dependencies {implementation 'com.applovin:applovin-sdk:13.0.0'implementation 'com.applovin.mediation:amazon-tam-adapter:9.10.2.0'implementation 'com.amazon.android:aps-sdk:9.10.2'implementation 'com.applovin.mediation:chartboost-adapter:9.7.0.3'implementation 'com.google.android.gms:play-services-base:16.1.0'implementation 'com.applovin.mediation:fyber-adapter:8.3.0.0'implementation 'com.applovin.mediation:google-ad-manager-adapter:23.3.0.1'implementation 'com.applovin.mediation:google-adapter:23.3.0.1'implementation 'com.applovin.mediation:inmobi-adapter:10.7.7.2'implementation 'com.squareup.picasso:picasso:2.71828'implementation 'androidx.recyclerview:recyclerview:1.1.0'implementation 'com.applovin.mediation:ironsource-adapter:8.3.0.0.2'implementation 'com.applovin.mediation:vungle-adapter:7.4.1.2'implementation 'com.applovin.mediation:facebook-adapter:6.18.0.0'implementation 'com.applovin.mediation:mintegral-adapter:16.8.51.2'implementation 'com.applovin.mediation:moloco-adapter:3.2.0.0'implementation 'com.applovin.mediation:bytedance-adapter:6.2.0.6.0'implementation 'com.applovin.mediation:smaato-adapter:22.7.0.1'implementation 'com.applovin.mediation:unityads-adapter:4.12.3.0'implementation 'com.applovin.mediation:yandex-adapter:7.5.0.0'implementation 'com.applovin.mediation:yso-network-adapter:1.2.6.0'implementation 'com.applovin.mediation:bigoads-adapter:4.9.1.0'implementation 'com.applovin.mediation:pubmatic-adapter:4.0.0.0'}
Kotlin DSL
dependencies {implementation ("com.applovin:applovin-sdk:13.0.0")implementation ("com.applovin.mediation:amazon-tam-adapter:9.10.2.0")implementation ("com.amazon.android:aps-sdk:9.10.2")implementation ("com.applovin.mediation:chartboost-adapter:9.7.0.3")implementation ("com.google.android.gms:play-services-base:16.1.0")implementation ("com.applovin.mediation:fyber-adapter:8.3.0.0")implementation ("com.applovin.mediation:google-ad-manager-adapter:23.3.0.1")implementation ("com.applovin.mediation:google-adapter:23.3.0.1")implementation ("com.applovin.mediation:inmobi-adapter:10.7.7.2")implementation ("com.squareup.picasso:picasso:2.71828")implementation ("androidx.recyclerview:recyclerview:1.1.0")implementation ("com.applovin.mediation:ironsource-adapter:8.3.0.0.2")implementation ("com.applovin.mediation:vungle-adapter:7.4.1.2")implementation ("com.applovin.mediation:facebook-adapter:6.18.0.0")implementation ("com.applovin.mediation:mintegral-adapter:16.8.51.2")implementation ("com.applovin.mediation:moloco-adapter:3.2.0.0")implementation ("com.applovin.mediation:bytedance-adapter:6.2.0.6.0")implementation ("com.applovin.mediation:smaato-adapter:22.7.0.1")implementation ("com.applovin.mediation:unityads-adapter:4.12.3.0")implementation ("com.applovin.mediation:yandex-adapter:7.5.0.0")implementation ("com.applovin.mediation:yso-network-adapter:1.2.6.0")implementation ("com.applovin.mediation:bigoads-adapter:4.9.1.0")implementation("com.applovin.mediation:pubmatic-adapter:4.0.0.0")}
iOS
Add following pods to your Podfile and run the command pod install--repo-update
# Settingsuse_frameworks!inhibit_all_warnings!# Podstarget 'YOUR_PROJECT_NAME' dopod 'AppLovinSDK'pod 'AppLovinMediationMolocoAdapter'pod 'AppLovinMediationChartboostAdapter'pod 'AppLovinMediationFyberAdapter'pod 'AppLovinMediationGoogleAdManagerAdapter'pod 'AppLovinMediationGoogleAdapter'pod 'AppLovinMediationInMobiAdapter'pod 'AppLovinMediationIronSourceAdapter'pod 'AppLovinMediationVungleAdapter'pod 'AppLovinMediationFacebookAdapter'pod 'AppLovinMediationMintegralAdapter'pod 'AppLovinMediationByteDanceAdapter'pod 'AppLovinMediationSmaatoAdapter'pod 'AppLovinMediationUnityAdsAdapter'pod 'AppLovinMediationYandexAdapter'end
Consent Management
Google UMP
To enable the AppLovin MAX Google UMP consent flow, set several properties of the SDK's settings
object before you initialize the SDK. Add following code blocks before you initialize the SDK:
AppLovinMAX.setTermsAndPrivacyPolicyFlowEnabled(true);AppLovinMAX.setPrivacyPolicyUrl('«https://your_company_name.com/privacy/»');// Terms of Service URL is optionalAppLovinMAX.setTermsOfServiceUrl('«https://your_company_name.com/terms/»');MaxConfiguration? sdkConfiguration = await AppLovinMAX.initialize(<var>LViME7X7lxKv-i-F_7zqiS5mftIkLozQDU3EVbAPn80KLVP7ImNA15ows7wdxZeVHHT-R_lIJO9TwH5bAxm7_N</var>);