Skip to main content

Smart AdServer mediation (legacy)

This article shows you how to deliver Teads ads on your application using the Smart Ad Server Mediation adapter.


Deprecated — use the Equativ adapter

TeadsSASAdapter targets Smart Display SDK 7 and is deprecated as of Teads SDK 6.3.0. It gets no further updates; critical fixes only.

  • Media / Media Native have no Equativ Display SDK 8 path yet. Stay on this adapter for them.
  • Interstitial is new with Equativ Display SDK 8. Use Equativ mediation (TeadsEquativAdapter). This adapter never served interstitials.
  • The two adapters cannot be installed in the same target. Pick one generation.
Sample App

The official Teads SDK sample application includes working Smart AdServer 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
  • Smart-Display-SDK 7.6.2+

Installation​

Before installing the Teads SAS adapter, you will need to integrate Smart Ad Server SDK into your application.

CocoaPods​

CocoaPods Trunk stopped accepting new pod versions on December 2, 2026, so Teads SDK 6.3.0 and later are not published there. Install the pods from the Teads public repository instead, pinned to a release tag. List TeadsSDK next to the adapter with the same tag: the adapter requires the same version of it. To upgrade, change the tag on both lines; version ranges such as ~> 6.3 don't work with :git.

  1. Add both pods to your Podfile:
pod 'TeadsSDK', :git => 'https://github.com/teads/TeadsSDK-iOS.git', :tag => '6.3.0'
pod 'TeadsSASAdapter', :git => 'https://github.com/teads/TeadsSDK-iOS.git', :tag => '6.3.0'
  1. Run the following to install them in your project.
$ pod install
  1. Follow the Defining a Custom Event step below (in the relevant tab) to finish the integration.

Manually​

  1. Integrate the latest version of the Teads inApp SDK to your project.
  2. Download the latest release of TeadsSASAdapter.
  3. Drop adapter files in your iOS project.
  4. Follow the Defining a Custom Event step below to finish the integration.

Formats​

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

Defining a Custom Event​

In order to display a Teads ad using Smart Ad, you need to create a custom event.

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

NameValue
SDK NameTeadsSDK
Ad Format TypeBanner
Adapter ClassTeadsSASAdapter.TeadsSASBannerAdapter
Placement Info{ "placementId": #PID#, "teadsAdSettingsKey": "[sas_kw | teadsAdSettingsKey]" }

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.

  • Concat your existing keywordsTargeting using TeadsSASAdapterHelper.concatAdSettingsToKeywords.
  • Create SASAdPlacement with your keywordsTargeting
let settings = TeadsAdapterSettings { settings in
settings.pageUrl("https://example.com/article1")
}

let webSiteId = #WebSiteId
let pageId = #PageId
let formatId = #formatId
var keywordsTargetting = "yourkeyword=something"
keywordsTargetting = TeadsSASAdapterHelper.concatAdSettingsToKeywords(keywordsStrings: keywordsTargetting, adSettings: teadsAdSettings)

// Create a placement
let adPlacement = SASAdPlacement(siteId: webSiteId, pageId: pageId, formatId: formatId, keywordTargeting: keywordsTargetting)

banner?.load(with: adPlacement)

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 SASBannerView that need to be resized

var sasAdView: SASBannerView!
@IBOutlet weak var slotHeight: NSLayoutConstraint! // set to 0 on InterfaceBuilder

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

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

You can instantiate a new listener as below, the listener needs to be a class member field or strong referenced somewhere, we keep internally a weak reference to it, so you are responsible to retain it and destroy it 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​