React Native SDK Integration
Integrating the SDK
Download the Latest Module
Download the AppLovin MAX React Native module through npm by issuing the following command: You can add that dependency to pubspec.yaml manually, or by issuing the following flutter command:
npm install react-native-applovin-max
Android Instructions
Add the following at the end of your build.gradle files:
buildscript {repositories {maven { url 'https://artifacts.applovin.com/android' }}}
iOS Instructions
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 AppLovinMAX, { Configuration } from "react-native-applovin-max";⋮AppLovinMAX.initialize("LViME7X7lxKv-i-F_7zqiS5mftIkLozQDU3EVbAPn80KLVP7ImNA15ows7wdxZeVHHT-R_lIJO9TwH5bAxm7_N").then((conf: Configuration) => {// SDK is initialized, start loading ads}).catch(error => {// Failed to initialize SDK});
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://repo.pubmatic.com/artifactory/public-repos") }maven { url = uri("https://ysonetwork.s3.eu-west-3.amazonaws.com/sdk/android") }}
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:
import AppLovinMAX, { Privacy } from 'react-native-applovin-max';Privacy.setTermsAndPrivacyPolicyFlowEnabled(true);Privacy.setPrivacyPolicyUrl('«https://your-company-name.com/privacy/»');// Terms of Service URL is optionalPrivacy.setTermsOfServiceUrl('«https://your-company-name.com/terms/»');AppLovinMAX.initialize("LViME7X7lxKv-i-F_7zqiS5mftIkLozQDU3EVbAPn80KLVP7ImNA15ows7wdxZeVHHT-R_lIJO9TwH5bAxm7_N").then((conf: Configuration) => {// SDK is initialized, start loading ads}).catch(error => {// Failed to initialize SDK});