Preparing Mediated Networks

  • Updated

When you integrate third-party SDKs into your Mobile Property, you are solely responsible for such integrations. You and the third-party SDK provider must ensure compliant data processing and treatment of any end user- or device-based privacy choices or flags.

iOS Instructions

Unreal Engine requires that you manually integrate mediated SDKs for iOS, since it currently does not support dependency managers like CocoaPods. The MAX Unreal plugin includes a Python script that downloads AppLovin adapters and generates build settings that you must copy into the iOS section of AppLovinMAX.Build.cs. You also must manually download the mediated SDKs and their dependencies.

  1. In a terminal, go to the Source/ThirdParty/IOS/Adapters/ directory in the plugin. This directory contains a Python 3.6+ script: install_adapters.py.
  2. Create a Podfile in that directory for the adapters you want to integrate (see the iOS section on this page for instructions).
  3. Run install_adapters.py to download the adapters.
  4. Copy the build rules generated by install_adapters.py into AppLovinMAX.Build.cs.
  5. Follow the instructions in the iOS section of this page. Add any necessary changes to Info.plist in AppLovinMAX_UPL_IOS.xml.
  6. Download the third-party SDKs and dependencies required by each installed adapter, and create a corresponding *.embeddedframework.zip file in the directory ThirdParty/IOS.
  7. Add iOS build rules for integrating any third-party dependencies into AppLovinMAX.Build.cs.

Android Instructions

You can download and integrate the MAX mediation adapters into your app in multiple ways:

Gradle
AppLovin recommends that you integrate adapters this way. AppLovin’s adapters’ POM files automatically integrate the mediated network’s SDK along with its dependencies.
Open Source Adapters
If you require more flexibility in the integration, you can integrate AppLovin’s open source adapters. Android SDK v11.0.0 is required in order to compile. You are responsible for integrating the mediated SDKs and any dependencies they require. You can find these adapters in the AppLovin-MAX-SDK-Android GitHub repository.
Manual Integration
Read the manual integration instructions if you want to integrate adapter artifacts, mediated SDKs, and their dependencies manually.

Gradle

Choose which mediated ad networks you want to integrate by checking the boxes below, and this page will display instructions specific to those networks. Then copy the customized UPL below into AppLovinMAX_UPL_Android.xml.

<AARImports>
</AARImports>

<buildGradleAdditions>
  <insert>
    allprojects {
      repositories {
        // You may add any additional repositories for other ad networks here
      }
    }
  </insert>
</buildGradleAdditions>

Update aar-imports.txt

Several network SDKs require a newer version of Google Play Services than the one included by default with Unreal Engine, so you’ll need to update the aar-imports.txt based on the Unreal Engine version you’re using. For example, to update the dependency versions for Unreal Engine 4.27 on macOS, you should modify the file located at /Users/Shared/Epic Games/UE_4.27/Engine/Build/Android/Java/aar-imports.txt.

⋮
com.google.android.gms,play-services-auth,16.0.1
com.google.android.gms,play-services-games,17.0.0
com.google.android.gms,play-services-nearby,16.0.0
com.google.android.gms,play-services-plus,16.0.0

Meta Audience Network Data Processing Options

If you do not want to enable Limited Data Use (LDU) mode, pass SetDataProcessingOptions() an empty string array:

⋮
<gameActivityImportAdditions>
  ⋮
  import com.facebook.ads.AdSettings;
</gameActivityImportAdditions>

<gameActivityOnCreateAdditions>
  <insert>
    AdSettings.setDataProcessingOptions( new String[] {} );
  </insert>
</gameActivityOnCreateAdditions>

To enable LDU for users and specify user geography, call SetDataProcessingOptions() in a form like this:

<gameActivityOnCreateAdditions>
  <insert>
    AdSettings.setDataProcessingOptions( new String[] {"LDU"}, 1, 1000 );
  </insert>
</gameActivityOnCreateAdditions>

Meta Audience Network Data Processing Options for Users in California

For information about how to implement Meta Audience Network’s “Limited Data Use” flag in California, visit the Meta for Developers documentation.

Add Your Google Bidding and Google AdMob / Google Ad Manager App ID

In your app’s AppLovinMAX_UPL_Android.xml, add your Google bidding and Google AdMob App ID under the androidManifestUpdates tag. In the example below, replace your-admob-app-id with your Google bidding and Google AdMob App ID.

<androidManifestUpdates>
⋮
    <addElements tag="application">
        <meta-data
        android:name="com.google.android.gms.ads.APPLICATION_ID"
        android:value="your-admob-app-id" />
    </addElements>
⋮
</androidManifestUpdates>

Google Mobile Ads SDK versions 20.5.0 and newer require that you set the compileSdkVersion of your app to 31 in build.gradle. Google Mobile Ads SDK version 20.4.0.1 is the most recent version that still supports setting compileSdkVersion to 30.

Enable Google Ad Manager

In your app’s AppLovinMAX_UPL_Android.xml, add a <meta-data> tag inside the application tag, as in the example below:

<androidManifestUpdates>
⋮
  <addElements tag="application">
    <meta-data
        android:name="com.google.android.gms.ads.AD_MANAGER_APP"
        android:value="true" />
  </addElements>
⋮
</androidManifestUpdates>