Integration

  • Updated

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

Download the Latest Cordova Plugin

You can download the AppLovin MAX Cordova plugin through npm by issuing the following command:

cordova plugin add cordova-plugin-applovin-max

If you want 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:+"
      }
    }
  • buildscript {
      repositories {
        maven { url = uri("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"    
    }
  • plugins {
      id("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:

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.

Ad assets that are fully cached result in a better user experience. Therefore, always initialize the AppLovin SDK on startup so as to give mediated networks the maximum amount of time to cache ads. This is especially important with video ads.

Do not use different network app IDs for the same network across different ad units. If you use different app IDs for the same network and app package name without using selective init you will break the network initialization process.

iOS 15 Global SKAdNetwork Reporting

Starting with iOS 15, Apple allows developers to send a copy of their SKAdNetwork install postbacks to an endpoint of their choice. MAX provides a Global SKAdNetwork Report (MAX > Mediation > Analyze > Global SKA Report) for developers to access the SKAdNetwork data across all their network partners in one place.

To leverage the MAX Global SKAdNetwork Report, enable iOS 15 SKAdNetwork reporting by using the app’s config.xml:

  1. In your app’s config.xml, create a new key named NSAdvertisingAttributionReportEndpoint of type String.
  2. Give that key the value: https://postbacks-app.com.

The final result should look something like this:

⋮
<iPhone>
  <InfoAdditions>
    <![CDATA[
      ⋮
      <key>NSAdvertisingAttributionReportEndpoint</key>
      <string>https://postbacks-app.com</string>
      ⋮
    ]]>
  </InfoAdditions>
</iPhone>

You can check the value of your app’s SKAdNetwork endpoint by using the Mediation Debugger.

To forward the SKAdNetwork postbacks to one or more third-party endpoints of your choice (including your MMP), please contact your account team.