- Latest Version: iOS release notes
- Sample App: Teads iOS Sample App
This native implementation is specifically designed to fit feed views
You can customize the ad view to look like the other cells around, to offer a more immersive experience.
- Prerequisites
- Installation
- Create a custom Network
- Enable Teads Custom Network a custom Network
- Integration
- Event Monitoring
- Mediation settings
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 12+
- Xcode: 15.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.
It will install the Teads adapter along with the Teads inApp SDK.
- Add Pod named TeadsAppLovinAdapter your Podfile:
- Run the following to install the adapter in your project.
- Follow the Defining a Custom Event 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
- Add a package by selecting
File
→Add Packages…
in Xcode’s menu bar. - Search for the Teads iOS SDK using the repo's URL:
- Next, set the Dependency Rule to be
Up to Next Major Version
and keep5.0.0 < 6.0.0
. - Choose the Teads product that you want to be installed in your app:
TeadsAppLovinAdapter
- Follow the Defining a Custom Event step below to finish the integration.
Alternatively, add Teads to your Package.swift manifest
- Add it to the
dependencies
of yourPackage.swift
:
- in any target that depends on a Teads product, add it to the
dependencies
array of that target:
- 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 a custom Network
Edit your Native adUnit on AppLovin dashboard and enable it
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
Note
Check out the sample ViewController from our iOS GitHub repository
Important
You're responsible for elements positioning: title label, main image, call to action button, …. These elements need to be visible (without overlay, even transparent ones) otherwise our visibility algorithm will consider the ad view as hidden.
Interface
- Add a new
AppLovinNativeAdView
class, this class must inherit fromMANativeAdView
- Add a new AppLovinNativeAdView xib file with Custom Class set to
AppLovinNativeAdView
- Set up the layout with UIKit elements (UILabel, UIButton, UIView, UIImageView). Set a different tag value to each element following AppLovin instructions Bind UI Components
NativeAdView Builder
- Instantiate
AppLovinNativeAdView
from xib
Use this static xib loader helper or your own implementation
- Bind views using defined tags
Load an Ad
- Instantiate adLoader
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
TeadsAdSettings
intoMANativeAdLoader
instance usingregister(into:)
.
- Perform ad request
Store Ad (Sequence)
When implementing native in a tableView or collectionView we suggest adding MANativeAdView
inside your sequence structure
implement MANativeAdDelegate
protocol to handle storage process
Ad Binding
Event Monitoring
The AppLovin SDK provides a delegate to monitor events during the ad life cycle and help you customize the ad experience in your apps.
Mediation settings
Find the full settings list here