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
Integrating Mediation Networks
Android
Add maven repositories url for the mediations networks to you project level build.gradle file.
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/" }}
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/") }}
Add following dependencies for mediation networks in app.level build.gradle file:
dependencies {implementation 'com.applovin.mediation:chartboost-adapter:9.7.0.0'implementation 'com.google.android.gms:play-services-base:16.1.0'implementation 'com.applovin.mediation:fyber-adapter:8.2.7.1'implementation 'com.applovin.mediation:google-ad-manager-adapter:23.0.0.1'implementation 'com.applovin.mediation:google-adapter:23.0.0.1'implementation 'com.applovin.mediation:inmobi-adapter:10.6.7.0'implementation 'com.squareup.picasso:picasso:2.71828'implementation 'androidx.recyclerview:recyclerview:1.1.0'implementation 'com.applovin.mediation:ironsource-adapter:8.0.0.0.0'implementation 'com.applovin.mediation:vungle-adapter:7.3.2.0'implementation 'com.applovin.mediation:facebook-adapter:6.17.0.0'implementation 'com.applovin.mediation:mintegral-adapter:16.7.31.0'implementation 'com.applovin.mediation:bytedance-adapter:5.9.0.4.0'implementation 'com.applovin.mediation:smaato-adapter:22.6.1.0'implementation 'com.applovin.mediation:unityads-adapter:4.10.0.0'implementation 'com.applovin.mediation:yandex-adapter:7.0.1.0'}
dependencies {implementation ("com.applovin.mediation:chartboost-adapter:9.7.0.0")implementation ("com.google.android.gms:play-services-base:16.1.0")implementation ("com.applovin.mediation:fyber-adapter:8.2.7.1")implementation ("com.applovin.mediation:google-ad-manager-adapter:23.0.0.1")implementation ("com.applovin.mediation:google-adapter:23.0.0.1")implementation ("com.applovin.mediation:inmobi-adapter:10.6.7.0")implementation ("com.squareup.picasso:picasso:2.71828")implementation ("androidx.recyclerview:recyclerview:1.1.0")implementation ("com.applovin.mediation:ironsource-adapter:8.0.0.0.0")implementation ("com.applovin.mediation:vungle-adapter:7.3.2.0")implementation ("com.applovin.mediation:facebook-adapter:6.17.0.0")implementation ("com.applovin.mediation:mintegral-adapter:16.7.31.0")implementation ("com.applovin.mediation:bytedance-adapter:5.9.0.4.0")implementation ("com.applovin.mediation:smaato-adapter:22.6.1.0")implementation ("com.applovin.mediation:unityads-adapter:4.10.0.0")implementation ("com.applovin.mediation:yandex-adapter:7.0.1.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 '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