Login
Welcome
Login

AppLovin MAX mediation - inRead


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

Using CocoaPods to have Teads AppLovin mediation plugin will automatically import the Teads inApp SDK framework.

Sample App on GitHub
Teads inApp SDK iOS sample App

Prerequisites

  • Platform: iOS 10+
  • Xcode: 12.5+
  • AppLovin SDK: 11.1.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.

It will install the Teads adapter along with the Teads inApp SDK.

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

Manually

  1. Integrate the latest version of the Teads inApp SDK to your project.
  2. Download the latest release of TeadsAppLovinAdapter.
  3. Drop adapter files in your iOS project.
  4. Follow the Defining a Custom Event 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.

Name Value
Network Type SDK
Custom Network Name Teads
iOS Adapter Class Name TeadsMediationAdapter

Enable Teads Custom Network in your ad unit

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

Important

Both of Banner or MREC is supported. However, AppLovin provide an auto refreshing feature that isn't realy 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 this case, we encourage you to set the max refresh interval.

See this article for more test PIDs serving different creative formats.

Name Value
App ID
Placement ID #PID

Important

Don't forget to replace the #PID# with your Teads placement ID.

Integration

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 here

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.