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 user-based or device-based privacy choices or flags.
You can download and integrate the MAX mediation adapters into your app in two ways:
Do not change the adapter’s name or package name. If you do so, the MAX SDK cannot recognize the adapter and ads will not load.
Choose which mediated ad networks you want to integrate by checking the boxes below. When you check those boxes, this page displays instructions specific to those networks.
// build.gradle
repositories {
google()
mavenCentral()
maven { url "https://artifactory.bidmachine.io/bidmachine" }
maven { url "https://cboost.jfrog.io/artifactory/chartboost-ads/" }
maven { url "https://imobile-maio.github.io/maven" }
maven { url "https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea" }
maven { url "https://maven.ogury.co" }
maven { url "https://artifact.bytedance.com/repository/pangle" }
maven { url "https://repo.pubmatic.com/artifactory/public-repos" }
maven { url "https://s3.amazonaws.com/smaato-sdk-releases/" }
maven { url "https://verve.jfrog.io/artifactory/verve-gradle-release" }
maven { url "https://ysonetwork.s3.eu-west-3.amazonaws.com/sdk/android" }
}
dependencies {
implementation 'com.applovin.mediation:amazon-tam-adapter:+'
implementation 'com.amazon.android:aps-sdk:+'
implementation 'com.applovin.mediation:bidmachine-adapter:+'
implementation 'com.applovin.mediation:bigoads-adapter:+'
implementation 'com.applovin.mediation:chartboost-adapter:+'
implementation 'com.google.android.gms:play-services-base:16.1.0'
implementation 'com.applovin.mediation:fyber-adapter:+'
implementation 'com.applovin.mediation:google-ad-manager-adapter:+'
implementation 'com.applovin.mediation:google-adapter:+'
implementation 'com.applovin.mediation:hyprmx-adapter:+'
implementation 'com.applovin.mediation:inmobi-adapter:+'
implementation 'com.squareup.picasso:picasso:2.8'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.applovin.mediation:ironsource-adapter:+'
implementation 'com.applovin.mediation:vungle-adapter:+'
implementation 'com.applovin.mediation:line-adapter:+'
implementation 'com.applovin.mediation:maio-adapter:+'
implementation 'com.applovin.mediation:facebook-adapter:+'
implementation 'com.applovin.mediation:mintegral-adapter:+'
implementation 'com.applovin.mediation:mobilefuse-adapter:+'
implementation 'com.applovin.mediation:moloco-adapter:+'
implementation 'com.applovin.mediation:ogury-presage-adapter:+'
implementation 'com.applovin.mediation:bytedance-adapter:+'
implementation 'com.applovin.mediation:pubmatic-adapter:+'
implementation 'com.applovin.mediation:smaato-adapter:+'
implementation 'com.applovin.mediation:unityads-adapter:+'
implementation 'com.applovin.mediation:verve-adapter:+'
implementation 'com.applovin.mediation:mytarget-adapter:+'
implementation 'com.applovin.mediation:yandex-adapter:+'
implementation 'com.applovin.mediation:yso-network-adapter:+'
}// build.gradle.kts
repositories {
google()
mavenCentral()
maven { url = uri("https://artifactory.bidmachine.io/bidmachine") }
maven { url = uri("https://cboost.jfrog.io/artifactory/chartboost-ads/") }
maven { url = uri("https://imobile-maio.github.io/maven") }
maven { url = uri("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea") }
maven { url = uri("https://maven.ogury.co") }
maven { url = uri("https://artifact.bytedance.com/repository/pangle") }
maven { url = uri("https://repo.pubmatic.com/artifactory/public-repos") }
maven { url = uri("https://s3.amazonaws.com/smaato-sdk-releases/") }
maven { url = uri("https://verve.jfrog.io/artifactory/verve-gradle-release") }
maven { url = uri("https://ysonetwork.s3.eu-west-3.amazonaws.com/sdk/android") }
}
dependencies {
implementation("com.applovin.mediation:amazon-tam-adapter:+")
implementation("com.amazon.android:aps-sdk:+")
implementation("com.applovin.mediation:bidmachine-adapter:+")
implementation("com.applovin.mediation:bigoads-adapter:+")
implementation("com.applovin.mediation:chartboost-adapter:+")
implementation("com.google.android.gms:play-services-base:16.1.0")
implementation("com.applovin.mediation:fyber-adapter:+")
implementation("com.applovin.mediation:google-ad-manager-adapter:+")
implementation("com.applovin.mediation:google-adapter:+")
implementation("com.applovin.mediation:hyprmx-adapter:+")
implementation("com.applovin.mediation:inmobi-adapter:+")
implementation("com.squareup.picasso:picasso:2.8")
implementation("androidx.recyclerview:recyclerview:1.1.0")
implementation("com.applovin.mediation:ironsource-adapter:+")
implementation("com.applovin.mediation:vungle-adapter:+")
implementation("com.applovin.mediation:line-adapter:+")
implementation("com.applovin.mediation:maio-adapter:+")
implementation("com.applovin.mediation:facebook-adapter:+")
implementation("com.applovin.mediation:mintegral-adapter:+")
implementation("com.applovin.mediation:mobilefuse-adapter:+")
implementation("com.applovin.mediation:moloco-adapter:+")
implementation("com.applovin.mediation:ogury-presage-adapter:+")
implementation("com.applovin.mediation:bytedance-adapter:+")
implementation("com.applovin.mediation:pubmatic-adapter:+")
implementation("com.applovin.mediation:smaato-adapter:+")
implementation("com.applovin.mediation:unityads-adapter:+")
implementation("com.applovin.mediation:verve-adapter:+")
implementation("com.applovin.mediation:mytarget-adapter:+")
implementation("com.applovin.mediation:yandex-adapter:+")
implementation("com.applovin.mediation:yso-network-adapter:+")
}Integrate AndroidX libraries into your project. Refer to the Migrate to AndroidX guide for more information on how to migrate your project.
Developers and publishers who use Google AdSense, AdManager, or AdMob must use a consent management platform (CMP) that Google certifies. The CMP must integrate with IAB’s Transparency and Consent Framework when you serve ads to users in the European Economic Area (EEA) or the UK. See Privacy: “TCF v2 consent” for more information.
In your app’s AndroidManifest.xml, add a <meta-data> tag inside the <application> tag.
The example below shows you the correct attributes of this tag.
Replace «your-admob-app-id» with your Google bidding and Google AdMob / Google Ad Manager App ID.
<?xml version="1.0" encoding="utf-8"?>
<manifest … >
<application … >
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="«your-admob-app-id»"/>
⋮
</application>
</manifest>
Google AdMob requires Android Gradle plugin version 4.2.0 or higher and Gradle version 6.7.1 or higher. If you see the following error, update your Android Gradle plugin and Gradle versions:
AAPT: error: unexpected element <property> found in <manifest><application>.
compileSdkVersionGoogle Mobile Ads SDK versions 23.1.0 and newer require a compileSdkVersion of at least 34.
Set the compileSdkVersion to 34 or higher in your app’s build.gradle.
Refer to the Google Mobile Ads SDK Release Notes for the latest compileSdkVersion requirements.
The Amazon Publisher Services SDK requires that you initialize it outside MAX SDK:
// Amazon requires an 'Activity' instance
AdRegistration.getInstance( "AMAZON_APP_ID", this );
AdRegistration.setMRAIDSupportedVersions( new String[] { "1.0", "2.0", "3.0" } );
AdRegistration.setMRAIDPolicy( MRAIDPolicy.CUSTOM );To integrate Amazon ads into MAX, you must load the Amazon ad first.
Before you load the MAX ad, pass the DTBAdResponse or AdError into the instance of MaxAdView.
You can do this by calling MaxAdView#setLocalExtraParameter().
For auto-refreshing banner ads, you only need to load the ad one time.
class ExampleActivity
extends Activity
{
⋮
private void loadAd()
{
String amazonAdSlotId;
MaxAdFormat adFormat;
if ( AppLovinSdkUtils.isTablet( getApplicationContext() ) )
{
amazonAdSlotId = "«Amazon-leader-slot-ID»";
adFormat = MaxAdFormat.LEADER;
}
else
{
amazonAdSlotId = "«Amazon-banner-slot-ID»";
adFormat = MaxAdFormat.BANNER;
}
// Raw size will be 320x50 for BANNERs on phones, and 728x90 for LEADERs on tablets
AppLovinSdkUtils.Size rawSize = adFormat.getSize();
DTBAdSize size = new DTBAdSize( rawSize.getWidth(), rawSize.getHeight(), amazonAdSlotId );
DTBAdRequest adLoader = new DTBAdRequest( getApplicationContext(), new DTBAdNetworkInfo( ApsAdNetwork.MAX ) );
adLoader.setSizes( size );
adLoader.loadAd( new DTBAdCallback()
{
@Override
public void onSuccess(@NonNull final DTBAdResponse dtbAdResponse)
{
// 'adView' is your instance of MaxAdView
adView.setLocalExtraParameter( "amazon_ad_response", dtbAdResponse );
adView.loadAd();
}
@Override
public void onFailure(@NonNull final AdError adError)
{
// 'adView' is your instance of MaxAdView
adView.setLocalExtraParameter( "amazon_ad_error", adError );
adView.loadAd();
}
} );
}
}class ExampleActivity : Activity()
{
private val adView: MaxAdView? = null
private fun loadAd()
{
val amazonAdSlotId: String
val adFormat: MaxAdFormat
if (AppLovinSdkUtils.isTablet(applicationContext))
{
amazonAdSlotId = "«Amazon-leader-slot-ID»"
adFormat = MaxAdFormat.LEADER
}
else
{
amazonAdSlotId = "«Amazon-banner-slot-ID»"
adFormat = MaxAdFormat.BANNER
}
// Raw size will be 320x50 for BANNERs on phones, and 728x90 for LEADERs on tablets
val rawSize = adFormat.size
val size = DTBAdSize(rawSize.width, rawSize.height, amazonAdSlotId)
val adLoader = DTBAdRequest( applicationContext, DTBAdNetworkInfo( ApsAdNetwork.MAX ) )
adLoader.setSizes(size)
adLoader.loadAd(object : DTBAdCallback
{
override fun onSuccess(dtbAdResponse: DTBAdResponse)
{
// 'adView' is your instance of MaxAdView
adView?.setLocalExtraParameter("amazon_ad_response", dtbAdResponse)
adView?.loadAd()
}
override fun onFailure(adError: AdError)
{
// 'adView' is your instance of MaxAdView
adView?.setLocalExtraParameter("amazon_ad_error", adError)
adView?.loadAd()
}
})
}
}class ExampleActivity
extends Activity
{
⋮
private void loadAd()
{
String amazonAdSlotId;
DTBAdRequest adLoader = new DTBAdRequest( getApplicationContext(), new DTBAdNetworkInfo( ApsAdNetwork.MAX ) );
adLoader.setSizes( new DTBAdSize( 300, 250, amazonAdSlotId ) );
adLoader.loadAd( new DTBAdCallback()
{
@Override
public void onSuccess(@NonNull final DTBAdResponse dtbAdResponse)
{
// 'adView' is your instance of MaxAdView
adView.setLocalExtraParameter( "amazon_ad_response", dtbAdResponse );
adView.loadAd();
}
@Override
public void onFailure(@NonNull final AdError adError)
{
// 'adView' is your instance of MaxAdView
adView.setLocalExtraParameter( "amazon_ad_error", adError );
adView.loadAd();
}
} );
}
}class ExampleActivity : Activity()
{
private val adView: MaxAdView? = null
private fun loadAd()
{
val amazonAdSlotId: String
val adLoader = DTBAdRequest( applicationContext, DTBAdNetworkInfo( ApsAdNetwork.MAX ) )
adLoader.setSizes(DTBAdSize(300, 250, amazonAdSlotId))
adLoader.loadAd(object : DTBAdCallback
{
override fun onSuccess(dtbAdResponse: DTBAdResponse)
{
// 'adView' is your instance of MaxAdView
adView!!.setLocalExtraParameter("amazon_ad_response", dtbAdResponse)
adView.loadAd()
}
override fun onFailure(adError: AdError)
{
// 'adView' is your instance of MaxAdView
adView!!.setLocalExtraParameter("amazon_ad_error", adError)
adView.loadAd()
}
})
}
}To integrate Amazon interstitial ads into MAX, you must load the Amazon ad first.
Before you load the MAX ad, pass the DTBAdResponse or AdError into the instance of MaxInterstitialAd.
You can do this by calling MaxInterstitialAd#setLocalExtraParameter().
You must load and pass the Amazon DTBAdResponse or DTBAdErrorInfo into the MaxInterstitialAd instance only once per session.
class ExampleActivity
extends Activity
{
private static MaxInterstitialAd interstitialAd; // static to ensure only one instance exists
private static boolean isFirstLoad = true;
private void loadAd()
{
if ( isFirstLoad )
{
isFirstLoad = false;
if ( interstitialAd == null )
{
interstitialAd = new MaxInterstitialAd( "«MAX-inter-ad-unit-ID»" );
}
DTBAdRequest adLoader = new DTBAdRequest( getApplicationContext(), new DTBAdNetworkInfo( ApsAdNetwork.MAX ) );
adLoader.setSizes( new DTBAdSize.DTBInterstitialAdSize( "«Amazon-inter-slot-ID»" ) );
adLoader.loadAd( new DTBAdCallback()
{
@Override
public void onSuccess(@NonNull final DTBAdResponse dtbAdResponse)
{
// 'interstitialAd' is your instance of MaxInterstitialAd
interstitialAd.setLocalExtraParameter( "amazon_ad_response", dtbAdResponse );
interstitialAd.loadAd();
}
@Override
public void onFailure(@NonNull final AdError adError)
{
// 'interstitialAd' is your instance of MaxInterstitialAd
interstitialAd.setLocalExtraParameter( "amazon_ad_error", adError );
interstitialAd.loadAd();
}
} );
}
else
{
interstitialAd.loadAd();
}
}
}class ExampleActivity : Activity()
{
private var interstitialAd: MaxInterstitialAd? = null // static to ensure only one instance exists
private var isFirstLoad = true
private fun loadAd()
{
if (isFirstLoad)
{
isFirstLoad = false
if (interstitialAd == null)
{
interstitialAd = MaxInterstitialAd("«MAX-inter-ad-unit-ID»", this)
}
val adLoader = DTBAdRequest( applicationContext, DTBAdNetworkInfo( ApsAdNetwork.MAX ) )
adLoader.setSizes(DTBAdSize.DTBInterstitialAdSize("«Amazon-inter-slot-ID»"))
adLoader.loadAd(object : DTBAdCallback
{
override fun onSuccess(dtbAdResponse: DTBAdResponse)
{
// 'interstitialAd' is your instance of MaxInterstitialAd
interstitialAd!!.setLocalExtraParameter("amazon_ad_response", dtbAdResponse)
interstitialAd!!.loadAd()
}
override fun onFailure(adError: AdError)
{
// 'interstitialAd' is your instance of MaxInterstitialAd
interstitialAd!!.setLocalExtraParameter("amazon_ad_error", adError)
interstitialAd!!.loadAd()
}
})
}
else
{
interstitialAd!!.loadAd()
}
}
}To integrate Amazon video interstitial ads into MAX, you must load the Amazon ad first.
Before you load the MAX ad, pass the DTBAdResponse or AdError into the instance of MaxInterstitialAd.
You can do this by calling MaxInterstitialAd#setLocalExtraParameter().
You must load and pass the DTBAdResponse or DTBAdErrorInfo into the MaxInterstitialAd instance only once per session.
class ExampleActivity
extends Activity
{
private static MaxInterstitialAd interstitialAd; // static to ensure only one instance exists
private static boolean isFirstLoad = true;
private void loadAd()
{
if ( isFirstLoad )
{
isFirstLoad = false;
if ( interstitialAd == null )
{
interstitialAd = new MaxInterstitialAd( "«MAX-inter-ad-unit-ID»" );
}
DTBAdRequest adLoader = new DTBAdRequest( getApplicationContext(), new DTBAdNetworkInfo( ApsAdNetwork.MAX ) );
// Switch video player width and height values(320, 480) depending on device orientation
adLoader.setSizes( new DTBAdSize.DTBVideo(320, 480, "«Amazon-video-inter-slot-ID»") );
adLoader.loadAd( new DTBAdCallback()
{
@Override
public void onSuccess(@NonNull final DTBAdResponse dtbAdResponse)
{
// 'interstitialAd' is your instance of MaxInterstitialAd
interstitialAd.setLocalExtraParameter( "amazon_ad_response", dtbAdResponse );
interstitialAd.loadAd();
}
@Override
public void onFailure(@NonNull final AdError adError)
{
// 'interstitialAd' is your instance of MaxInterstitialAd
interstitialAd.setLocalExtraParameter( "amazon_ad_error", adError );
interstitialAd.loadAd();
}
} );
}
else
{
interstitialAd.loadAd();
}
}
}class ExampleActivity : Activity()
{
private var interstitialAd: MaxInterstitialAd? = null // static to ensure only one instance exists
private var isFirstLoad = true
private fun loadAd()
{
if (isFirstLoad)
{
isFirstLoad = false
if (interstitialAd == null)
{
interstitialAd = MaxInterstitialAd("«MAX-inter-ad-unit-iD»", this)
}
val adLoader = DTBAdRequest( applicationContext, DTBAdNetworkInfo( ApsAdNetwork.MAX ) )
// Switch video player width and height values(320, 480) depending on device orientation
adLoader.setSizes(DTBAdSize.DTBVideo(320, 480, "«Amazon-video-inter-slot-ID»"))
adLoader.loadAd(object : DTBAdCallback
{
override fun onSuccess(dtbAdResponse: DTBAdResponse)
{
// 'interstitialAd' is your instance of MaxInterstitialAd
interstitialAd!!.setLocalExtraParameter("amazon_ad_response", dtbAdResponse)
interstitialAd!!.loadAd()
}
override fun onFailure(adError: AdError)
{
// 'interstitialAd' is your instance of MaxInterstitialAd
interstitialAd!!.setLocalExtraParameter("amazon_ad_error", adError)
interstitialAd!!.loadAd()
}
})
}
else
{
interstitialAd!!.loadAd()
}
}
}To integrate Amazon rewarded videos into MAX, first load the Amazon ad.
Before you load the MAX ad, pass the DTBAdResponse or AdError into the instance of MaxRewardedAd.
You can do this by calling MaxRewardedAd#setLocalExtraParameter().
You must load and pass the DTBAdResponse or AdError into the MaxRewardedAd instance only once per session.
class ExampleActivity
extends Activity
{
private static MaxRewardedAd rewardedAd; // static to ensure only one instance exists
private static boolean isFirstLoad = true;
private void loadAd()
{
if ( isFirstLoad )
{
isFirstLoad = false;
if ( rewardedAd == null )
{
rewardedAd = MaxRewardedAd.getInstance( "«MAX-rewarded-ad-unit-ID»" );
}
DTBAdRequest adLoader = new DTBAdRequest( getApplicationContext(), new DTBAdNetworkInfo( ApsAdNetwork.MAX ) );
// Switch video player width and height values(320, 480) depending on device orientation
adLoader.setSizes( new DTBAdSize.DTBVideo( 320, 480, "«Amazon-video-rewarded-slot-ID»" ) );
adLoader.loadAd( new DTBAdCallback()
{
@Override
public void onSuccess(@NonNull final DTBAdResponse dtbAdResponse)
{
// 'rewardedAd' is your instance of MaxRewardedAd
rewardedAd.setLocalExtraParameter( "amazon_ad_response", dtbAdResponse );
rewardedAd.loadAd();
}
@Override
public void onFailure(@NonNull final AdError adError)
{
// 'rewardedAd' is your instance of MaxRewardedAd
rewardedAd.setLocalExtraParameter( "amazon_ad_error", adError );
rewardedAd.loadAd();
}
} );
}
else
{
rewardedAd.loadAd();
}
}
}class ExampleActivity
extends Activity
{
private static MaxRewardedAd rewardedAd; // static to ensure only one instance exists
private static boolean isFirstLoad = true;
private void loadAd()
{
if ( isFirstLoad )
{
isFirstLoad = false;
if ( rewardedAd == null )
{
rewardedAd = MaxRewardedAd.getInstance( "«MAX-rewarded-ad-unit-ID»" );
}
DTBAdRequest adLoader = new DTBAdRequest( getApplicationContext(), new DTBAdNetworkInfo( ApsAdNetwork.MAX ) );
// Switch video player width and height values(320, 480) depending on device orientation
adLoader.setSizes( new DTBAdSize.DTBVideo( 320, 480, "«Amazon-video-rewarded-slot-ID»" ) );
adLoader.loadAd( new DTBAdCallback()
{
@Override
public void onSuccess(@NonNull final DTBAdResponse dtbAdResponse)
{
// 'rewardedAd' is your instance of MaxRewardedAd
rewardedAd.setLocalExtraParameter( "amazon_ad_response", dtbAdResponse );
rewardedAd.loadAd();
}
@Override
public void onFailure(@NonNull final AdError adError)
{
// 'rewardedAd' is your instance of MaxRewardedAd
rewardedAd.setLocalExtraParameter( "amazon_ad_error", adError );
rewardedAd.loadAd();
}
} );
}
else
{
rewardedAd.loadAd();
}
}
}AppLovin recommends that you enable test mode for Amazon’s SDK. This allows you to receive test ads. Enable test mode by making the following calls:
AdRegistration.enableTesting( true );
AdRegistration.enableLogging( true );
You can filter your waterfalls such that they contain only Amazon ads. To do this, navigate to Select Live Network in the Mediation Debugger and select the Amazon network.
If you do not want to enable Limited Data Use (LDU) mode, pass SetDataProcessingOptions() an empty string array:
import com.facebook.ads.AdSettings;
⋮
AdSettings.setDataProcessingOptions( new String[] {} );
⋮
// Initialize MAX SDKimport com.facebook.ads.AdSettings
⋮
AdSettings.setDataProcessingOptions( arrayOf<String>() )
⋮
// Initialize MAX SDKTo enable LDU for users and specify user geography, call SetDataProcessingOptions() in a form like this:
import com.facebook.ads.AdSettings;
⋮
AdSettings.setDataProcessingOptions( new String[] {"LDU"}, «country», «state» );
⋮
// Initialize MAX SDKimport com.facebook.ads.AdSettings
⋮
AdSettings.setDataProcessingOptions( arrayOf("LDU"), «country», «state» )
⋮
// Initialize MAX SDKIf you use Google UMP as your CMP, you can determine whether the user has consented to Meta or not. To do so, use code like the following:
Boolean hasMetaConsent = AppLovinPrivacySettings.getAdditionalConsentStatus( 89 );
if ( hasMetaConsent != null )
{
// Set Meta Data Processing Options accordingly.
}
else
{
// AC String is not available on disk. Please check for consent status after the user completes the CMP flow.
}val hasMetaConsent = AppLovinPrivacySettings.getAdditionalConsentStatus(89)
if ( hasMetaConsent != null )
{
// Set Meta Data Processing Options accordingly.
}
else
{
// AC String is not available on disk. Please check for consent status after the user completes the CMP flow.
}To learn how to implement Meta Audience Network’s “Limited Data Use” flag in California, visit the Meta for Developers documentation.
If you use code obfuscation or resource shrinking, follow Pangle’s Obfuscation guidelines.
Some network SDKs include the <queries> element in their bundled Android Manifest files.
If you use an incompatible version of the Android Gradle plugin, this causes one of the following build errors:
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
error: unexpected element <queries> found in <manifest>.
Missing 'package' key attribute on element package at [:com.my.target.mytarget-sdk-5.11.3:]
AndroidManifest Validation failed
To fix this error, upgrade to one of the following versions of the Android Gradle plugin.
These versions support the <queries> element:
Upgrade the Android Gradle Plugin, not the Gradle Build Tools.
| Current Android Gradle plugin version | Version that supports <queries> element |
|---|---|
| 4.1.* | All |
| 4.0.* | 4.0.1+ |
| 3.6.* | 3.6.4+ |
| 3.5.* | 3.5.4+ |
| 3.4.* | 3.4.3+ |
| 3.3.* | 3.3.3+ |
You can download and integrate the MAX mediation adapters into your app in two ways:
Do not change the adapter’s name. If you do so, the MAX SDK cannot recognize the adapter and ads will not load.
Choose which mediated ad networks you want to integrate by checking the boxes below. Then this page displays instructions specific to those networks. This page also customizes a CocoaPods script for you. Copy the customized CocoaPods script below to your Podfile.
# Settings
use_frameworks!
inhibit_all_warnings!
# Pods
target 'YOUR_PROJECT_NAME' do
pod 'AmazonPublisherServicesSDK'
pod 'AppLovinMediationAmazonAdMarketplaceAdapter'
pod 'AppLovinMediationBidMachineAdapter'
pod 'AppLovinMediationBigoAdsAdapter'
pod 'AppLovinMediationChartboostAdapter'
pod 'AppLovinMediationCSJAdapter'
pod 'AppLovinMediationFyberAdapter'
pod 'AppLovinMediationGoogleAdManagerAdapter'
pod 'AppLovinMediationGoogleAdapter'
pod 'AppLovinMediationHyprMXAdapter'
pod 'AppLovinMediationInMobiAdapter'
pod 'AppLovinMediationIronSourceAdapter'
pod 'AppLovinMediationVungleAdapter'
pod 'AppLovinMediationLineAdapter'
pod 'AppLovinMediationMaioAdapter'
pod 'AppLovinMediationFacebookAdapter'
pod 'AppLovinMediationMintegralAdapter'
pod 'AppLovinMediationMobileFuseAdapter'
pod 'AppLovinMediationMolocoAdapter'
pod 'AppLovinMediationOguryPresageAdapter'
pod 'AppLovinMediationByteDanceAdapter'
pod 'AppLovinMediationPubMaticAdapter'
pod 'AppLovinMediationSmaatoAdapter'
pod 'AppLovinMediationTencentGDTAdapter'
pod 'AppLovinMediationUnityAdsAdapter'
pod 'AppLovinMediationVerveAdapter'
pod 'AppLovinMediationMyTargetAdapter'
pod 'AppLovinMediationYandexAdapter'
pod 'AppLovinMediationYSONetworkAdapter'
endStarting from Pangle iOS adapter version 4.9.1.0.0, Pangle is no longer available in Chinese Mainland. To monetize Chinese Mainland traffic, configure the CSJ network and add the CSJ adapter. For global traffic that excludes Chinese Mainland, you can continue to use Pangle for monetization.
To support Swift for iOS versions below 12.2:

window propertyDo not remove the window property of your App Delegate file.
If you do so, InMobi’s SDK may crash.
@property (nonatomic, strong) UIWindow *window;
var window: UIWindow?If you do not want to enable Limited Data Use (LDU) mode, pass SetDataProcessingOptions() an empty array:
#import <FBAudienceNetwork/FBAudienceNetwork.h>
⋮
[FBAdSettings setDataProcessingOptions: @[]];
⋮
// Initialize MAX SDK
import FBAudienceNetwork
⋮
FBAdSettings.setDataProcessingOptions([])
⋮
// Initialize MAX SDKTo enable LDU for users and to specify user geography, call SetDataProcessingOptions() like this:
#import <FBAudienceNetwork/FBAudienceNetwork.h>
⋮
[FBAdSettings setDataProcessingOptions: @[@"LDU"] country: «country» state: «state»];
⋮
// Initialize MAX SDK
import FBAudienceNetwork
⋮
FBAdSettings.setDataProcessingOptions(["LDU"], country: «country», state: «state»)
⋮
// Initialize MAX SDKIf you use Google UMP as your CMP, you can determine whether the user has consented to Meta or not. To do so, use code like the following:
NSNumber *hasMetaConsent = [ALPrivacySettings additionalConsentStatusForIdentifier: 89];
if ( hasMetaConsent )
{
BOOL consentGiven = hasMetaConsent.boolValue;
// Set Meta Data Processing Options accordingly.
}
else
{
// AC String is not available on disk. Please check for consent status after the user completes the CMP flow.
}
let hasMetaConsent = ALPrivacySetting.additionalConsentStatus(forIdentifier: 89)
if let consentGiven = hasMetaConsent?.boolValue
{
// Set Meta Data Processing Options accordingly.
}
else
{
// AC String is not available on disk. Please check for consent status after the user completes the CMP flow.
}To learn how to implement Meta Audience Network’s “Limited Data Use” flag in California, read the Meta for Developers documentation.
Audience Network SDK 6.2.1 introduces these important requirements:
setAdvertiserTrackingEnabled flag, irrespective of the use of mediation.
This informs Meta whether it can use the data to deliver personalized ads.Info.plist so that advertisers can measure the success of ad campaigns.
Refer to the SKAdNetwork documentation for integration instructions.[sdk initializeSdkWithCompletionHandler:^(ALSdkConfiguration *sdkConfiguration)
{
if ( @available(iOS 14.5, *) )
{
// Note that App transparency tracking authorization can be checked via `sdkConfiguration.appTrackingTransparencyStatus`
// 1. Set Meta ATE flag here, THEN
}
// 2. Load ads
}];
sdk.initializeSdk { (sdkConfiguration: ALSdkConfiguration) in
if #available(iOS 14.5, *)
{
// Note that App transparency tracking authorization can be checked via `sdkConfiguration.appTrackingTransparencyStatus`
// 1. Set Meta ATE flag here, THEN
}
// 2. Load ads
}Developers and publishers who use Google AdSense, AdManager, or AdMob must use a consent management platform (CMP) that Google certifies. The CMP must integrate with IAB’s Transparency and Consent Framework when you serve ads to users in the European Economic Area (EEA) or the UK. See Privacy: “TCF v2 consent” for more information.
In your app’s Info.plist, add a GADApplicationIdentifier key.
Give this key the String value of your Google bidding and Google AdMob / Google Ad Manager App ID.

The Amazon Publisher Services SDK requires that you initialize it outside MAX SDK:
[[DTBAds sharedInstance] setAppKey: appId];
[DTBAds sharedInstance].mraidCustomVersions = @[@"1.0", @"2.0", @"3.0"];
[DTBAds sharedInstance].mraidPolicy = CUSTOM_MRAID;
Use the latest Amazon Publisher Services adapter version to avoid reporting discrepancies.
To integrate Amazon ads into MAX, you must load the Amazon ad first.
Before you load the MAX ad, pass the DTBAdResponse or DTBAdErrorInfo into the instance of MAAdView.
You can do this by calling -[MAAdView setLocalExtraParameterForKey:value:].
For auto-refreshing banner ads you need to load the ad only once.
@interface ExampleViewController ()<DTBAdCallback>
⋮
@end
@implementation ExampleViewController
- (void)viewDidLoad
{
[super viewDidLoad];
NSString *amazonAdSlotId;
MAAdFormat *adFormat;
if ( UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad )
{
amazonAdSlotId = @"«Amazon-leader-slot-ID»";
adFormat = MAAdFormat.leader;
}
else
{
amazonAdSlotId = @"«Amazon-banner-slot-ID»";
adFormat = MAAdFormat.banner;
}
CGSize rawSize = adFormat.size;
DTBAdSize *size = [[DTBAdSize alloc] initBannerAdSizeWithWidth: rawSize.width
height: rawSize.height
andSlotUUID: amazonAdSlotId];
DTBAdNetworkInfo *adNetworkInfo = [[DTBAdNetworkInfo alloc] initWithNetworkName: DTBADNETWORK_MAX];
DTBAdLoader *adLoader = [[DTBAdLoader alloc] initWithAdNetworkInfo: adNetworkInfo];
[adLoader setAdSizes: @[size]];
[adLoader loadAd: self];
}
- (void)onSuccess:(DTBAdResponse *)adResponse
{
// 'adView' is your instance of MAAdView
[self.adView setLocalExtraParameterForKey: @"amazon_ad_response" value: adResponse];
[self.adView loadAd];
}
- (void)onFailure:(DTBAdError)error dtbAdErrorInfo:(DTBAdErrorInfo *)errorInfo
{
// 'adView' is your instance of MAAdView
[self.adView setLocalExtraParameterForKey: @"amazon_ad_error" value: errorInfo];
[self.adView loadAd];
}
@end
import AppLovinSDK
import DTBiOSSDK
class ExampleViewController: UIViewController
{
override func viewDidLoad()
{
super.viewDidLoad()
let amazonAdSlotId: String
let adFormat: MAAdFormat
if UIDevice.current.userInterfaceIdiom == .pad
{
amazonAdSlotId = "«Amazon-leader-slot-ID»"
adFormat = MAAdFormat.leader
}
else
{
amazonAdSlotId = "«Amazon-banner-slot-ID»"
adFormat = MAAdFormat.banner
}
let rawSize = adFormat.size
let size = DTBAdSize(bannerAdSizeWithWidth: Int(rawSize.width),
height: Int(rawSize.height),
andSlotUUID: amazonAdSlotId)!
let adLoader = DTBAdLoader(adNetworkInfo: DTBAdNetworkInfo(networkName: DTBADNETWORK_MAX))
adLoader.setAdSizes([size])
adLoader.loadAd(self)
}
}
extension ExampleViewController: DTBAdCallback
{
func onSuccess(_ adResponse: DTBAdResponse!)
{
// 'adView' is your instance of MAAdView
adView.setLocalExtraParameterForKey("amazon_ad_response", value: adResponse)
adView.loadAd()
}
func onFailure(_ error: DTBAdError, dtbAdErrorInfo: DTBAdErrorInfo!)
{
// 'adView' is your instance of MAAdView
adView.setLocalExtraParameterForKey("amazon_ad_error", value:dtbAdErrorInfo)
adView.loadAd()
}
}import AppLovinSDK
import DTBiOSSDK
struct ExampleSwiftUIWrapper: UIViewRepresentable
{
func makeUIView(context: Context) -> MAAdView
{
let adView = MAAdView(adUnitIdentifier: "«ad-unit-ID»")
adView.delegate = context.coordinator
let amazonAdSlotId: String
let adFormat: MAAdFormat
if UIDevice.current.userInterfaceIdiom == .pad
{
amazonAdSlotId = "«Amazon-leader-slot-ID»"
adFormat = MAAdFormat.leader
}
else
{
amazonAdSlotId = "«Amazon-banner-slot-ID»"
adFormat = MAAdFormat.banner
}
let rawSize = adFormat.size
let size = DTBAdSize(bannerAdSizeWithWidth: Int(rawSize.width),
height: Int(rawSize.height),
andSlotUUID: amazonAdSlotId)!
let adLoader = DTBAdLoader(adNetworkInfo: DTBAdNetworkInfo(networkName: DTBADNETWORK_MAX))
adLoader.setAdSizes([size])
adLoader.loadAd(adView)
return adView
}
}
extension ExampleSwiftUIWrapper
{
class Coordinator: DTBAdCallback
{
func onSuccess(_ adResponse: DTBAdResponse!)
{
// 'adView' is your instance of MAAdView
adView.setLocalExtraParameterForKey("amazon_ad_response", value: adResponse)
adView.loadAd()
}
func onFailure(_ error: DTBAdError, dtbAdErrorInfo: DTBAdErrorInfo!)
{
// 'adView' is your instance of MAAdView
adView.setLocalExtraParameterForKey("amazon_ad_error", value: dtbAdErrorInfo)
adView.loadAd()
}
}
}@interface ExampleViewController ()<DTBAdCallback>
⋮
@end
@implementation ExampleViewController
- (void)viewDidLoad
{
[super viewDidLoad];
NSString *amazonAdSlotId = @"«Amazon-MREC-slot-ID»";
DTBAdNetworkInfo *adNetworkInfo = [[DTBAdNetworkInfo alloc] initWithNetworkName: DTBADNETWORK_MAX];
DTBAdLoader *adLoader = [[DTBAdLoader alloc] initWithAdNetworkInfo: adNetworkInfo];
[adLoader setAdSizes: [[DTBAdSize alloc] initBannerAdSizeWithWidth: 300
height: 250
andSlotUUID: amazonAdSlotId]];
[adLoader loadAd: self];
}
- (void)onSuccess:(DTBAdResponse *)adResponse
{
// 'adView' is your instance of MAAdView
[self.adView setLocalExtraParameterForKey: @"amazon_ad_response" value: adResponse];
[self.adView loadAd];
}
- (void)onFailure:(DTBAdError)error dtbAdErrorInfo:(DTBAdErrorInfo *)errorInfo
{
// 'adView' is your instance of MAAdView
[self.adView setLocalExtraParameterForKey: @"amazon_ad_error" value: errorInfo];
[self.adView loadAd];
}
@end
import AppLovinSDK
import DTBiOSSDK
class ExampleViewController: UIViewController
{
override func viewDidLoad()
{
super.viewDidLoad()
let amazonAdSlotId: String = "«Amazon-MREC-slot-ID»"
let adLoader = DTBAdLoader(adNetworkInfo: DTBAdNetworkInfo(networkName: DTBADNETWORK_MAX))
adLoader.setAdSizes([DTBAdSize(bannerAdSizeWithWidth: 300,
height: 250,
andSlotUUID: amazonAdSlotId)!])
adLoader.loadAd(self)
}
}
extension ExampleViewController: DTBAdCallback
{
func onSuccess(_ adResponse: DTBAdResponse!)
{
// 'adView' is your instance of MAAdView
adView.setLocalExtraParameterForKey("amazon_ad_response", value: adResponse)
adView.loadAd()
}
func onFailure(_ error: DTBAdError, dtbAdErrorInfo: DTBAdErrorInfo!)
{
// 'adView' is your instance of MAAdView
adView.setLocalExtraParameterForKey("amazon_ad_error", value:dtbAdErrorInfo)
adView.loadAd()
}
}import AppLovinSDK
import DTBiOSSDK
struct ExampleSwiftUIWrapper: UIViewRepresentable
{
func makeUIView(context: Context) -> MAAdView
{
let adView = MAAdView(adUnitIdentifier: "«ad-unit-ID»", adFormat: MAAdFormat.mrec)
adView.delegate = context.coordinator
let amazonAdSlotId: String = "«Amazon-MREC-slot-ID»"
let adLoader = DTBAdLoader(adNetworkInfo: DTBAdNetworkInfo(networkName: DTBADNETWORK_MAX))
adLoader.setAdSizes([DTBAdSize(bannerAdSizeWithWidth: 300,
height: 250,
andSlotUUID: amazonAdSlotId)!])
adLoader.loadAd(adView)
return adView
}
}
extension ExampleSwiftUIWrapper
{
class Coordinator: DTBAdCallback
{
func onSuccess(_ adResponse: DTBAdResponse!)
{
// 'adView' is your instance of MAAdView
adView.setLocalExtraParameterForKey("amazon_ad_response", value: adResponse)
adView.loadAd()
}
func onFailure(_ error: DTBAdError, dtbAdErrorInfo: DTBAdErrorInfo!)
{
// 'adView' is your instance of MAAdView
adView.setLocalExtraParameterForKey("amazon_ad_error", value: dtbAdErrorInfo)
adView.loadAd()
}
}
}To integrate Amazon interstitial ads into MAX, you must load the Amazon ad first.
Before you load the MAX ad, pass the DTBAdResponse or DTBAdErrorInfo into the instance of MAInterstitialAd.
You can do this by calling -[MAInterstitialAd setLocalExtraParameterForKey:value:].
You must load and pass the Amazon DTBAdResponse or DTBAdErrorInfo into the MAInterstitialAd instance only once per session.
#import <AppLovinSDK/AppLovinSDK.h>
#import <DTBiOSSDK/DTBiOSSDK.h>
@interface ExampleViewController ()<DTBAdCallback>
⋮
@end
@implementation ExampleViewController
static MAInterstitialAd *interstitialAd;
static BOOL isFirstLoad;
+ (void)initialize
{
[super initialize];
interstitialAd = [[MAInterstitialAd alloc] initWithAdUnitIdentifier: @"«MAX-inter-ad-unit-ID»"];
isFirstLoad = YES;
}
- (void)loadAd
{
// If first load - load ad from Amazon's SDK, then load ad for MAX
if ( isFirstLoad )
{
isFirstLoad = NO;
DTBAdNetworkInfo *adNetworkInfo = [[DTBAdNetworkInfo alloc] initWithNetworkName: DTBADNETWORK_MAX];
DTBAdLoader *adLoader = [[DTBAdLoader alloc] initWithAdNetworkInfo: adNetworkInfo];
[adLoader setAdSizes: @[
[[DTBAdSize alloc] initInterstitialAdSizeWithSlotUUID: @"«Amazon-inter-slot-ID»"]
]];
[adLoader loadAd: self];
}
else
{
[interstitialAd loadAd];
}
}
- (void)onSuccess:(DTBAdResponse *)adResponse
{
// 'interstitialAd' is your instance of MAInterstitialAd
[interstitialAd setLocalExtraParameterForKey: @"amazon_ad_response" value: adResponse];
[interstitialAd loadAd];
}
- (void)onFailure:(DTBAdError)error dtbAdErrorInfo:(DTBAdErrorInfo *)errorInfo
{
// 'interstitialAd' is your instance of MAInterstitialAd
[interstitialAd setLocalExtraParameterForKey: @"amazon_ad_error" value: errorInfo];
[interstitialAd loadAd];
}
@end
import AppLovinSDK
import DTBiOSSDK
class ExampleViewController: UIViewController
{
private static var interstitialAd = MAInterstitialAd(adUnitIdentifier: "«MAX-inter-ad-unit-ID»")
private static var isFirstLoad = true
func loadAd()
{
// If first load - load ad from Amazon's SDK, then load ad for MAX
if Self.isFirstLoad
{
Self.isFirstLoad = false
let adLoader = DTBAdLoader(adNetworkInfo: DTBAdNetworkInfo(networkName: DTBADNETWORK_MAX))
adLoader.setAdSizes([DTBAdSize(interstitialAdSizeWithSlotUUID: "«Amazon-inter-slot-ID»")!])
adLoader.loadAd(self)
}
else
{
Self.interstitialAd.load()
}
}
}
extension ExampleViewController: DTBAdCallback
{
func onSuccess(_ adResponse: DTBAdResponse!)
{
// 'interstitialAd' is your instance of MAInterstitialAd
Self.interstitialAd.setLocalExtraParameterForKey("amazon_ad_response", value: adResponse)
Self.interstitialAd.load()
}
func onFailure(_ error: DTBAdError, dtbAdErrorInfo: DTBAdErrorInfo!)
{
// 'interstitialAd' is your instance of MAInterstitialAd
Self.interstitialAd.setLocalExtraParameterForKey("amazon_ad_error", value: dtbAdErrorInfo)
Self.interstitialAd.load()
}
}To integrate Amazon interstitial ads into MAX, you must load the Amazon ad first.
Before you load the MAX ad, pass the DTBAdResponse or DTBAdErrorInfo into the instance of MAInterstitialAd.
You can do this by calling -[MAInterstitialAd setLocalExtraParameterForKey:value:]
You must load and pass the Amazon DTBAdResponse or DTBAdErrorInfo into the MAInterstitialAd instance only once per session.
#import <AppLovinSDK/AppLovinSDK.h>
#import <DTBiOSSDK/DTBiOSSDK.h>
@interface ExampleViewController ()<DTBAdCallback>
⋮
@end
@implementation ExampleViewController
static MAInterstitialAd *interstitialAd;
static BOOL isFirstLoad;
+ (void)initialize
{
[super initialize];
interstitialAd = [[MAInterstitialAd alloc] initWithAdUnitIdentifier: @"«MAX-inter-ad-unit-ID»"];
isFirstLoad = YES;
}
- (void)loadAd
{
// If first load - load ad from Amazon's SDK, then load ad for MAX
if ( isFirstLoad )
{
isFirstLoad = NO;
DTBAdNetworkInfo *adNetworkInfo = [[DTBAdNetworkInfo alloc] initWithNetworkName: DTBADNETWORK_MAX];
DTBAdLoader *adLoader = [[DTBAdLoader alloc] initWithAdNetworkInfo: adNetworkInfo];
// Switch video player width and height values(320, 480) depending on device orientation
[adLoader setAdSizes: @[
[[DTBAdSize alloc] initVideoAdSizeWithPlayerWidth: 320 height: 480 andSlotUUID:@"«Amazon-video-inter-slot-ID»"]
]];
[adLoader loadAd: self];
}
else
{
[interstitialAd loadAd];
}
}
- (void)onSuccess:(DTBAdResponse *)adResponse
{
// 'interstitialAd' is your instance of MAInterstitialAd
[interstitialAd setLocalExtraParameterForKey: @"amazon_ad_response" value: adResponse];
[interstitialAd loadAd];
}
- (void)onFailure:(DTBAdError)error dtbAdErrorInfo:(DTBAdErrorInfo *)errorInfo
{
// 'interstitialAd' is your instance of MAInterstitialAd
[interstitialAd setLocalExtraParameterForKey: @"amazon_ad_error" value: errorInfo];
[interstitialAd loadAd];
}
@end
import AppLovinSDK
import DTBiOSSDK
class ExampleViewController: UIViewController
{
private static var interstitialAd = MAInterstitialAd(adUnitIdentifier: "«MAX-inter-ad-unit-ID»")
private static var isFirstLoad = true
func loadAd()
{
// If first load - load ad from Amazon's SDK, then load ad for MAX
if Self.isFirstLoad
{
Self.isFirstLoad = false
let adLoader = DTBAdLoader(adNetworkInfo: DTBAdNetworkInfo(networkName: DTBADNETWORK_MAX))
// Switch video player width and height values(320, 480) depending on device orientation
adLoader.setAdSizes([DTBAdSize(videoAdSizeWithPlayerWidth: 320, height: 480, andSlotUUID: "«Amazon-video-inter-slot-ID»")!])
adLoader.loadAd(self)
}
else
{
Self.interstitialAd.load()
}
}
}
extension ExampleViewController: DTBAdCallback
{
func onSuccess(_ adResponse: DTBAdResponse!)
{
// 'interstitialAd' is your instance of MAInterstitialAd
Self.interstitialAd.setLocalExtraParameterForKey("amazon_ad_response", value: adResponse)
Self.interstitialAd.load()
}
func onFailure(_ error: DTBAdError, dtbAdErrorInfo: DTBAdErrorInfo!)
{
// 'interstitialAd' is your instance of MAInterstitialAd
Self.interstitialAd.setLocalExtraParameterForKey("amazon_ad_error", value: dtbAdErrorInfo)
Self.interstitialAd.load()
}
}To integrate Amazon rewarded videos into MAX, you must load the Amazon ad first.
Before you load the MAX ad, pass the DTBAdResponse or DTBAdErrorInfo into the instance of MARewardedAd.
You can do this by calling -[MARewardedAd setLocalExtraParameterForKey:value:].
You must load and pass the Amazon DTBAdResponse or DTBAdErrorInfo into the MARewardedAd instance only once.
#import <AppLovinSDK/AppLovinSDK.h>
#import <DTBiOSSDK/DTBiOSSDK.h>
@interface ExampleViewController ()<DTBAdCallback>
⋮
@end
@implementation ExampleViewController
static MARewardedAd *rewardedAd;
static BOOL isFirstLoad;
+ (void)initialize
{
[super initialize];
rewardedAd = [MARewardedAd sharedWithAdUnitIdentifier: @"«MAX-rewarded-ad-unit-ID»"];
isFirstLoad = YES;
}
- (void)loadAd
{
// If first load - load ad from Amazon's SDK, then load ad for MAX
if ( isFirstLoad )
{
isFirstLoad = NO;
DTBAdNetworkInfo *adNetworkInfo = [[DTBAdNetworkInfo alloc] initWithNetworkName: DTBADNETWORK_MAX];
DTBAdLoader *adLoader = [[DTBAdLoader alloc] initWithAdNetworkInfo: adNetworkInfo];
// Switch video player width and height values(320, 480) depending on device orientation
[adLoader setAdSizes: @[
[[DTBAdSize alloc] initVideoAdSizeWithPlayerWidth: 320 height: 480 andSlotUUID:@"«Amazon-video-rewarded-slot-ID»"]
]];
[adLoader loadAd: self];
}
else
{
[rewardedAd loadAd];
}
}
- (void)onSuccess:(DTBAdResponse *)adResponse
{
// 'rewardedAd' is your instance of MARewardedAd
[rewardedAd setLocalExtraParameterForKey: @"amazon_ad_response" value: adResponse];
[rewardedAd loadAd];
}
- (void)onFailure:(DTBAdError)error dtbAdErrorInfo:(DTBAdErrorInfo *)errorInfo
{
// 'rewardedAd' is your instance of MARewardedAd
[rewardedAd setLocalExtraParameterForKey: @"amazon_ad_error" value: errorInfo];
[rewardedAd loadAd];
}
@end
import AppLovinSDK
import DTBiOSSDK
class ExampleViewController: UIViewController
{
private static var rewardedAd = MARewardedAd.shared(withAdUnitIdentifier: "«MAX-rewarded-ad-unit-ID»")
private static var isFirstLoad = true
func loadAd()
{
// If first load - load ad from Amazon's SDK, then load ad for MAX
if Self.isFirstLoad
{
Self.isFirstLoad = false
let adLoader = DTBAdLoader(adNetworkInfo: DTBAdNetworkInfo(networkName: DTBADNETWORK_MAX))
// Switch video player width and height values(320, 480) depending on device orientation
adLoader.setAdSizes([DTBAdSize(videoAdSizeWithPlayerWidth: 320, height: 480, andSlotUUID: "«Amazon-video-rewarded-slot-ID»")!])
adLoader.loadAd(self)
}
else
{
Self.rewardedAd.load()
}
}
}
extension ExampleViewController: DTBAdCallback
{
func onSuccess(_ adResponse: DTBAdResponse!)
{
// 'rewardedAd' is your instance of MARewardedAd
Self.rewardedAd.setLocalExtraParameterForKey("amazon_ad_response", value: adResponse)
Self.rewardedAd.load()
}
func onFailure(_ error: DTBAdError, dtbAdErrorInfo: DTBAdErrorInfo!)
{
// 'rewardedAd' is your instance of MARewardedAd
Self.rewardedAd.setLocalExtraParameterForKey("amazon_ad_error", value: dtbAdErrorInfo)
Self.rewardedAd.load()
}
}AppLovin recommends that you enable test mode for Amazon’s SDK. When you do this, you receive test ads. Enable test mode with the following calls:
[[DTBAds sharedInstance] setLogLevel: DTBLogLevelAll];
[[DTBAds sharedInstance] setTestMode: YES];
DTBAds.sharedInstance().setLogLevel(DTBLogLevelAll)
DTBAds.sharedInstance().testMode = trueYou can filter your waterfalls such that they contain only Amazon ads. To do this, navigate to Select Live Network in the Mediation Debugger and select the Amazon network.
To disable App Transport Security (ATS), add NSAppTransportSecurity to your app’s Info.plist.
Then add the key NSAllowsArbitraryLoads and set its Boolean value to YES.
Make sure this is the only key present.

Refer to the SKAdNetwork documentation for integration instructions.
Run the following on the command line.
pod install --repo-update