Teads SDK provides seamless access to both premium video advertising and content recommendation capabilities through a modern, unified interface. This sample app includes Teads iOS framework and demonstrates integration examples for Media Placements (video ads), Native Ads, and Feed Placements (content recommendations).
- Integration Documentation
- Migrating to v6
- Run the sample app
- SwiftUI sample app
- Installation
- Mediation Adapters
- Certifications
- Changelog
- Integration instructions are available on Teads Developer Portal.
- Installation guide is available here.
- Full integration guide is available here.
TeadsSDK v6 introduces a new unified createPlacement API. See Migration Documentation for details.
Both sample apps use Swift Package Manager β no pod install step is needed.
- Clone this repository.
- Open
TeadsSampleApp.xcodeprojand let Xcode resolve the packages (FileβPackagesβResolve Package Versionsif it does not start automatically). - Select the
TeadsSampleAppscheme and run.
There is no Xcode workspace: each sample app is a standalone project that you open directly.
The sample apps resolve the following packages:
| Package | Version | Provides |
|---|---|---|
SampleApps/TeadsSampleAppDependencies (local) |
β | TeadsSDK, TeadsAdMobAdapter and TeadsAppLovinAdapter (the xcframeworks of Frameworks/) and TeadsSASAdapter, built from the MediationAdapters/TeadsSASAdapter sources |
| swift-package-manager-google-mobile-ads | 12.12.0 ..< 13.0.0 |
GoogleMobileAds |
| AppLovin-MAX-Swift-Package | 13.4.0 ..< 14.0.0 |
AppLovinSDK |
| swift-package-manager-display-sdk | 7.24.2 ..< 8.0.0 |
SASDisplayKit |
Both app targets declare the exact same package requirements, and the exact versions they were validated against are committed in each project's project.xcworkspace/xcshareddata/swiftpm/Package.resolved. Keep the two lockfiles in sync when you bump a dependency: since the projects resolve independently, a divergence there is not reported as a conflict.
The prebuilt
TeadsAdMobAdapter.xcframeworkstill exposesGADCustomEventExtras, which the Google Mobile Ads SDK removed in 13.0.0, hence the12.xrequirement.
Code formatting is checked by a SwiftFormat build phase: it runs swiftformat --lint when SwiftFormat is installed locally (brew install swiftformat) and is skipped otherwise. Run swiftformat . from the repository root to apply the fixes.
Alongside the UIKit TeadsSampleApp, this repository ships a SwiftUI sample, TeadsSwiftUISampleApp, demonstrating Teads integration in SwiftUI-first apps. Both apps are standalone Xcode projects consuming the same Swift packages.
- Open
TeadsSwiftUISampleApp.xcodeproj. - Select the
TeadsSwiftUISampleAppscheme and run on an iOS 16+ simulator.
The SwiftUI sample mirrors the UIKit TeadsSampleApp parity matrix and uses the same public test PIDs:
| Format | Provider | Containers |
|---|---|---|
| InRead | Direct | ScrollView, List, LazyVGrid, paginated TabView, WKWebView via UIViewRepresentable |
| InRead | AdMob, AppLovin, SAS | ScrollView, List, WKWebView (where the provider supports the integration) |
| Native | Direct | List, LazyVStack, tag-based List |
| Native | AdMob, AppLovin, SAS | List |
| Interstitial | AdMob | Article paywall + interstitial presentation |
| Showcase | Direct | Media (video) + Feed (content recommendations) in a single article |
The root catalogue (RootCatalogView) mirrors the UIKit RootController selection flow: Format β Provider β Creative β Integration, plus a Validation Mode toggle and a custom-PID alert.
The Direct InRead samples use the official SwiftUI API shipped by the SDK:
import SwiftUI
import TeadsSDK
struct ContentView: View {
private let config = TeadsAdPlacementMediaConfig(pid: 84242, articleUrl: URL(string: "https://www.teads.com"))
var body: some View {
ScrollView {
// ...article content...
TeadsAdPlacementSwiftUIView<TeadsAdPlacementMedia>(config: config)
}
}
}You can also use the .teadsAdPlacement(config:delegate:) view modifier, which stacks the ad below the modified content. For readability, the sample app aliases the generic view as TeadsMediaSwiftUIView (= TeadsAdPlacementSwiftUIView<TeadsAdPlacementMedia>) and TeadsFeedSwiftUIView for the Feed equivalent.
Mediation (AdMob, AppLovin, SAS), Native ads (any provider, including Teads Direct via TeadsAdPlacementMediaNative/TeadsNativeAdView) and the AdMob Interstitial flow render UIKit views. The sample bridges them into SwiftUI with focused UIViewRepresentable / UIViewControllerRepresentable wrappers (AdMobBannerHost, AppLovinBannerHost, SASBannerHost, TeadsNativeAdHost, etc.) β the same pattern publishers will use when embedding mediated ads in a SwiftUI screen.
CocoaPods remains a supported distribution channel: the podspecs at the root of this repository (TeadsSDK.podspec and the adapter ones) are the ones published to the trunk. Only the sample apps of this repository switched to Swift Package Manager.
To install the TeadsSDK just put this on your podfile, if you've never used cocoapods before please check the offical documentation.
pod 'TeadsSDK', '~> 6.0.5'On your terminal, go to the directory containing your project's .xcodeproj file and your Podfile and run pod install command. This will install Teads SDK along with our needed dependencies.
pod install --repo-updateBefore installing Teads adapter, you need to implement Google Mobile Ads in your application.
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.
- Add a package by selecting
FileβAdd Packagesβ¦in Xcodeβs menu bar. - Search for the Teads iOS SDK using the repo's URL:
https://github.com/teads/TeadsSDK-iOS- Next, set the Dependency Rule to be
Up to Next Major Versionand keep6.0.0 < 7.0.0. - Choose the Teads product that you want to be installed in your app:
TeadsSDK
- Add it to the
dependenciesof yourPackage.swift:
dependencies: [
.package(url: "https://github.com/teads/TeadsSDK-iOS", .upToNextMajor(from: "6.0.0"))
]- in any target that depends on a Teads product, add it to the
dependenciesarray of that target:
.target(
name: "MyTargetName",
dependencies: [
// The product(s) you want (e.g. TeadsSDK).
.product(name: "TeadsSDK", package: "Teads"),
]
),Teads SDK supports the IAB Open Measurement SDK, also known as OM SDK. The OM SDK brings transparency to the advertising world, giving a way to standardize the viewability and verification measurement for the ads served through mobile apps. Teads is part of the IAB's compliant companies.
See changelog here or check the Release Notes.
