跳转到内容

Integration

此内容尚不支持你的语言。

This page shows you how to download, configure, and initialize the AppLovin MAX Cordova Plugin.

Download the Latest Plugin

Download the AppLovin MAX Cordova plugin through npm by issuing the following command:

Terminal window
cordova plugin add cordova-plugin-applovin-max

To receive release updates, subscribe to the AppLovin MAX Cordova Plugin GitHub repository.

Enable Ad Review

To enable the MAX Ad Review service, follow the instructions below for Android or iOS:

Android Instructions

Add the following at the end of your build.gradle files:

Additions to Root-Level build.gradle File

buildscript {
repositories {
maven { url 'https://artifacts.applovin.com/android' }
}
dependencies {
classpath "com.applovin.quality:AppLovinQualityServiceGradlePlugin:+"
}
}

Additions to App-Level build.gradle File

apply plugin: 'applovin-quality-service'
applovin {
apiKey "«your-ad-review-key»"
}

You can find your Ad Review Key in the Account > General > Keys section of the AppLovin dashboard.

iOS Instructions

Download AppLovinQualityServiceSetup-ios.rb and move it into your project folder. Open a terminal window, cd to your project directory, and run:

Terminal window
ruby AppLovinQualityServiceSetup-ios.rb

Initialize the SDK

Add the code snippet below into your app’s main home screen:

var AppLovinMAX = cordova.require('cordova-plugin-applovin-max.AppLovinMAX');
AppLovinMAX.initialize("«SDK-key»", function (configuration) {
// SDK is initialized, start loading ads
});

You 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.

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.