Skip to main content

AppLovin MAX mediation

This article shows you how to deliver Teads ads in your application using the AppLovin Mediation adapter.


Sample App

The official Teads SDK sample application includes working AppLovin MAX integrations. Use it for implementation examples and as a reference while you set up this adapter.

Teads iOS Sample App on GitHub

Prerequisites​

  • Platform: iOS 14+
  • Xcode: 26.2+
  • Built with Swift 6.2.3
  • AppLovin SDK: 12.3.1+

Installation​

Before installing the Teads AppLovin adapter, you will need to integrate AppLovin SDK into your application.

CocoaPods​

If your project is managing dependencies through CocoaPods, you just need to add this pod in your Podfile.

Using CocoaPods for the Teads AppLovin mediation plugin automatically imports the Teads inApp SDK framework.

  1. Add Pod named TeadsAppLovinAdapter your Podfile:
pod 'TeadsAppLovinAdapter', '~> 6.2'
  1. Run the following to install the adapter in your project.
$ pod install --repo-update
  1. Follow the Create a custom Network step below to finish the integration.

Swift Package Manager​

SPM is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.

Installing from Xcode​

  1. Add a package by selecting File → Add Packages… in Xcode’s menu bar.
  2. Search for the Teads iOS SDK using the repo's URL:
https://github.com/teads/TeadsSDK-iOS
  1. Next, set the Dependency Rule to be Up to Next Major Version and specify 6.2.1 < 7.0.0.
  2. Choose the Teads product that you want to be installed in your app: TeadsAppLovinAdapter
  3. Follow the Create a custom Network step below to finish the integration.

Alternatively, add Teads to your Package.swift manifest​

  1. Add it to the dependencies of your Package.swift:
dependencies: [
.package(url: "https://github.com/teads/TeadsSDK-iOS", .upToNextMajor(from: "6.2.1"))
]
  1. in any target that depends on a Teads product, add it to the dependencies array of that target:
.target(
name: "MyTargetName",
dependencies: [
.product(name: "TeadsAppLovinAdapter", package: "Teads"),
]
),
  1. Follow the Create a custom Network step below to finish the integration.

Create a custom Network​

In order to display a Teads ad using AppLovin, you need to create a custom Network.

NameValue
Network TypeSDK
Custom Network NameTeads
iOS Adapter Class NameTeadsMediationAdapter

Formats​

Pick the ad format you are integrating. Each format has its own setup.

Enable Teads Custom Network in your ad unit​

Edit your banner or MREC adUnit on AppLovin dashboard and enable it

Refresh interval

Both Banner and MREC are supported. AppLovin provides an auto-refreshing feature that isn't compatible with Teads. We strongly recommend disabling it.

For MREC, you can set the refresh interval to No Interval, but for Banner you can't avoid this feature. In that case, set the max refresh interval.

See the SDK documentation for more test PIDs serving different creative formats.

NameValue
Placement ID#PID — use 84242 for Media testing. Production PIDs come from your account manager.

Integration​

Sample

See the sample ViewController from our iOS GitHub repository.

You have the ability to pass extra parameters in order to customize third-party ad network settings. For Teads, you need to pass TeadsAdapterSettings.

  • Register your TeadsAdapterSettings into MAAdView using method register.
let adSettings = TeadsAdapterSettings { settings in
settings.pageUrl("https://example.com/article1")
}
let bannerView = MAAdView(adUnitIdentifier: APPLOVIN_AD_UNIT_ID)
bannerView.register(teadsAdSettings: adSettings)

bannerView.loadAd()

Ad Resizing​

The code below must be implemented to enable the resizing of the mediated ad slot making possible the rendering of square and vertical creatives.

Register to ad resizing through TeadsAdapterSettings by providing your delegate class and the MAAdView that need to be resized

var bannerView: MAAdView!
@IBOutlet weak var slotHeight: NSLayoutConstraint! // set to 0 on InterfaceBuilder

let adSettings = TeadsAdapterSettings { settings in
settings.registerAdView(bannerView, delegate: self)
}

Simply conform to the Teads delegate TeadsMediatedAdViewDelegate and implements the didUpdateRatio function.

You can implement delegate as below, we keep internally a weak reference to it, so it's not retained when you don't need it anymore:

func didUpdateRatio(_ adView: UIView, adRatio: TeadsAdRatio) {
let height = adRatio.calculateHeight(for: slotView.frame.width) // call calculateHeight
slotHeight.constant = height //update NSLayoutConstraint of the slot
}

Mediation settings​

Find the full settings list in Settings Configuration — TeadsAdapterSettings.

Checklist​