Skip to content

teads/TeadsSDK-iOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

913 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Teads SDK for iOS

Teads logo


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).

πŸ“‹ Table of Contents

πŸ“š Integration Documentation

πŸ•Š Migrating to v6

TeadsSDK v6 introduces a new unified createPlacement API. See Migration Documentation for details.

🚲 Run the sample app

Clone this repository, open it with Xcode, and run project.

πŸ“± SwiftUI sample app

Alongside the UIKit TeadsSampleApp, the workspace ships a SwiftUI sample, TeadsSwiftUISampleApp, demonstrating Teads integration in SwiftUI-first apps. Both apps share the same workspace and Pods.

  1. Run pod install.
  2. Open TeadsSampleApp.xcworkspace.
  3. Select the TeadsSwiftUISampleApp scheme and run on an iOS 16+ simulator.

Coverage

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.

Direct InRead β€” official SwiftUI API

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, Native and Interstitial β€” UIViewRepresentable

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.

πŸ“¦ Install the Teads SDK iOS framework

Cocoapods

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-update

Before installing Teads adapter, you need to implement Google Mobile Ads in your application.

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 keep 6.0.0 < 7.0.0.
  2. Choose the Teads product that you want to be installed in your app: TeadsSDK

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.0.0"))
]
  1. in any target that depends on a Teads product, add it to the dependencies array of that target:
.target(
  name: "MyTargetName",
  dependencies: [
    // The product(s) you want (e.g. TeadsSDK).
    .product(name: "TeadsSDK", package: "Teads"),
  ]
),

🀝 Mediation Adapters

πŸŽ“ Certifications

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.

iab certification badge

⌚️ Changelog

See changelog here or check the Release Notes.