This page shows you how to download, import, and configure the AppLovin React Native module.
Download the AppLovin MAX React Native module through npm by issuing the following command:
To receive release updates, subscribe to the AppLovin MAX React Native module GitHub repository.
To enable the MAX Ad Review service, follow the instructions below:
Add the following at the end of your build.gradle files:
[COMPONENT: AdReviewKey]
Download
[COMPONENT: AdReviewLink]
and move it into your project folder.
Open a terminal window, cd to your project directory, and run:
Add the code snippet below into your app’s main home screen:
[COMPONENT: SdkKey]
[COMPONENT: Cached]
[COMPONENT: IOS14Support]
Version 5 of the React Native module includes major updates to support Promises and callbacks. This breaks backward-compatibility. This section summarizes these updates.
Native UI Components (AppLovinMAX.AdView and AppLovinMAX.NativeAdView) can declare callbacks directly in the component itself.
Type-specific event listeners take the type as an argument.
These replace generic event listeners.
For example there is now AppLovinMAX.addInterstitialLoadedEventListener(listener) instead of AppLovinMAX.addEventListener(type, listener).
Twelve formerly synchronous methods with return values now use the Promises architecture.
You can use chaining via then/catch or async/await when you access the value passed by the Promise.
The following table shows the updated methods.
| Method | resolve return type | reject return type |
|---|---|---|
AppLovinMAX.getAdaptiveBannerHeightForWidth(width) | height (float) | ⸺ |
AppLovinMAX.hasUserConsent() | boolean | ⸺ |
AppLovinMAX.initialize(sdkKey) | Configuration object | error |
AppLovinMAX.isAppOpenAdReady(adunitId) | boolean | error |
AppLovinMAX.isDoNotSell() | boolean | ⸺ |
AppLovinMAX.isInitialized() | boolean | ⸺ |
AppLovinMAX.isInterstitialReady(adUnitId) | boolean | error |
AppLovinMAX.isMuted() | boolean | ⸺ |
AppLovinMAX.isRewardedAdReady(adunitId) | boolean | error |
AppLovinMAX.isTablet() | boolean | ⸺ |
AppLovinMAX.showCmpForExistingUser() | null | error |
You can also reference this commit in the demo app which demonstrates what a migration to use these new methods might look like.
Version 6 of the React Native module includes major updates to support TypeScript and modules. This breaks backward-compatibility. This section summarizes these updates.
TypeScript became the React Native default application programming language as of React Native version 0.71. Version 6 of the React Native module migrates the code base to TypeScript.
Previous versions exported a single module, AppLovinMAX, which encompassed all the functions of MAX.
Version 6 categorizes these functions into a set of modules.
The architecture of version 6 resembles that of version 5, but updates function signatures to adapt to this introduction of modules.
The major new modules are as follows:
| Module | Function |
|---|---|
AppLovinMAX (default) | integration (initialization and general-purpose functions) |
Privacy | privacy, terms flow |
AppOpenAd | app open ads |
BannerAd | banner ads |
InterstitialAd | interstitial ads |
MRecAd | medium rectangle (MREC) ads |
NativeAdView | native ads |
Version 9 of the React Native module introduces support for the new architecture in React Native while preserving the existing APIs and functionalities. Due to certain limitations in the new architecture, it modifies some capabilities.
Waterfall information API support removed in AdInfo
: The AdInfo object no longer supports the waterfall information API.
Changes to extraParameters and localExtraParameters in AdView and NativeAdView
: These parameters now support only string and boolean values.
Set these values to an empty string ("") where previously you may have set these values to null.
You can find your Ad Review 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.
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.
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.
You can find your SDK key in the Account > General > Keys section of the AppLovin dashboard.
RewardedAd | rewarded ads |
AdView | banners and MRECs (UI components) |
Version 5 of the React Native module includes a major upgrade to support Promises and callbacks. This upgrade breaks backward-compatibility. For a summary of the changes, see React Native v5 migration guide below.
Version 6 of the React Native module includes major updates to support TypeScript and modules. TypeScript is the React Native default application programming language as of React Native version 0.71. This module upgrade breaks backward-compatibility. For a summary of the changes, see React Native v6 migration guide below.
Version 9 of the React Native module introduces support for the new architecture in React Native. It preserves existing APIs and functionalities. Due to certain limitations in the new architecture, it modifies some capabilities. For a summary of these changes, see React Native v9 migration guide below.