Skip to content

Commit 38f20e9

Browse files
Merge pull request #203 from teads/adapters-spm
SPM support for TeadsAdMobAdapter and TeadsAppLovinAdapter
2 parents adf2be9 + 94f4f84 commit 38f20e9

File tree

7 files changed

+212
-10
lines changed

7 files changed

+212
-10
lines changed
File renamed without changes.

MediationAdapters/TeadsAdMobAdapter/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,43 @@ pod 'TeadsAdMobAdapter', '~> 5.0'
3636
3. Follow the [Define Custom Event](https://support.teads.tv/support/solutions/articles/36000314767-inread-google-ad-manager-and-admob-mediation#defining_a_custom_event) step to finish the integration.
3737
4. You’re done.
3838

39+
### Swift Package Manager
40+
41+
[SPM](https://swift.org/package-manager/) 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.
42+
43+
#### Installing from Xcode
44+
45+
1. Add a package by selecting `File``Add Packages…` in Xcode’s menu bar.
46+
2. Search for the Teads iOS SDK using the repo's URL:
47+
```console
48+
https://github.com/teads/TeadsSDK-iOS
49+
```
50+
3. Next, set the **Dependency Rule** to be `Up to Next Major Version` and keep `5.0.0 < 6.0.0`.
51+
4. Choose the Teads product that you want to be installed in your app: `TeadsAdMobAdapter`
52+
5. Follow the [Define Custom Event](https://support.teads.tv/support/solutions/articles/36000314767-inread-google-ad-manager-and-admob-mediation#defining_a_custom_event) step to finish the integration.
53+
54+
#### Alternatively, add Teads to your Package.swift manifest
55+
1. Add it to the `dependencies` of your `Package.swift`:
56+
57+
```swift
58+
dependencies: [
59+
.package(url: "https://github.com/teads/TeadsSDK-iOS", .upToNextMajor(from: "5.0.0"))
60+
]
61+
```
62+
63+
2. in any target that depends on a Teads product, add it to the `dependencies` array of that target:
64+
65+
```swift
66+
.target(
67+
name: "MyTargetName",
68+
dependencies: [
69+
.product(name: "TeadsAdMobAdapter", package: "Teads"),
70+
]
71+
),
72+
```
73+
74+
3. Follow the [Define Custom Event](https://support.teads.tv/support/solutions/articles/36000314767-inread-google-ad-manager-and-admob-mediation#defining_a_custom_event) step to finish the integration.
75+
3976
## Integration Documentation
4077

4178
Integration instructions are available on [Teads SDK Documentation](https://support.teads.tv/support/solutions/articles/36000314767-inread-google-ad-manager-and-admob-mediation).
File renamed without changes.

MediationAdapters/TeadsAppLovinAdapter/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,43 @@ pod 'TeadsAppLovinAdapter', '~> 5.0'
3636
3. Follow the [Create a custom Network](https://support.teads.tv/support/solutions/articles/36000357700-inread-applovin-mediation#create-a-custom-network) step to finish the integration.
3737
4. You’re done.
3838

39+
### Swift Package Manager
40+
41+
[SPM](https://swift.org/package-manager/) 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.
42+
43+
#### Installing from Xcode
44+
45+
1. Add a package by selecting `File``Add Packages…` in Xcode’s menu bar.
46+
2. Search for the Teads iOS SDK using the repo's URL:
47+
```console
48+
https://github.com/teads/TeadsSDK-iOS
49+
```
50+
3. Next, set the **Dependency Rule** to be `Up to Next Major Version` and keep `5.0.0 < 6.0.0`.
51+
4. Choose the Teads product that you want to be installed in your app: `TeadsAppLovinAdapter`
52+
5. Follow the [Create a custom Network](https://support.teads.tv/support/solutions/articles/36000357700-inread-applovin-mediation#create-a-custom-network) step to finish the integration.
53+
54+
#### Alternatively, add Teads to your Package.swift manifest
55+
1. Add it to the `dependencies` of your `Package.swift`:
56+
57+
```swift
58+
dependencies: [
59+
.package(url: "https://github.com/teads/TeadsSDK-iOS", .upToNextMajor(from: "5.0.0"))
60+
]
61+
```
62+
63+
2. in any target that depends on a Teads product, add it to the `dependencies` array of that target:
64+
65+
```swift
66+
.target(
67+
name: "MyTargetName",
68+
dependencies: [
69+
.product(name: "TeadsAppLovinAdapter", package: "Teads"),
70+
]
71+
),
72+
```
73+
74+
3. Follow the [Create a custom Network](https://support.teads.tv/support/solutions/articles/36000357700-inread-applovin-mediation#create-a-custom-network) step to finish the integration.
75+
3976

4077
## Integration Documentation
4178

Package.resolved

Lines changed: 70 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,18 @@
33
import PackageDescription
44

55
let teadsModuleName = "TeadsSDK"
6+
let teadsAdMobAdapterModuleName = "TeadsAdMobAdapter"
7+
let teadsAppLovinAdapterModuleName = "TeadsAppLovinAdapter"
8+
let teadsSASAdapterModuleName = "TeadsSASAdapter"
9+
let mediationAdaptersDirectory = "MediationAdapters"
10+
let googleMobileAdsModuleName = "GoogleMobileAds"
11+
let appLovinMaxModuleName = "AppLovinSDK"
612
let omModuleName = "OMSDK_Teadstv"
13+
let commonModuleName = "TeadsAdapterCommon"
14+
let commonModuleNamePath = "Common"
715

816
let package = Package(
9-
name: teadsModuleName,
17+
name: "Teads",
1018
platforms: [
1119
.iOS(.v10),
1220
],
@@ -15,6 +23,26 @@ let package = Package(
1523
name: teadsModuleName,
1624
targets: [teadsModuleName, omModuleName]
1725
),
26+
.library(
27+
name: teadsAdMobAdapterModuleName,
28+
targets: [teadsAdMobAdapterModuleName]
29+
),
30+
.library(
31+
name: teadsAppLovinAdapterModuleName,
32+
targets: [teadsAppLovinAdapterModuleName]
33+
),
34+
],
35+
dependencies: [
36+
.package(
37+
name: googleMobileAdsModuleName,
38+
url: "https://github.com/googleads/swift-package-manager-google-mobile-ads.git",
39+
from: "9.0.0"
40+
),
41+
.package(
42+
name: appLovinMaxModuleName,
43+
url: "https://github.com/AppLovin/AppLovin-MAX-Swift-Package.git",
44+
.upToNextMajor(from: "11.1.1")
45+
),
1846
],
1947
targets: [
2048
.binaryTarget(
@@ -25,5 +53,29 @@ let package = Package(
2553
name: omModuleName,
2654
path: "Frameworks/\(omModuleName).xcframework"
2755
),
56+
.target(
57+
name: commonModuleName,
58+
path: "\(mediationAdaptersDirectory)/\(commonModuleNamePath)"
59+
),
60+
.target(
61+
name: teadsAdMobAdapterModuleName,
62+
dependencies: [
63+
.product(name: googleMobileAdsModuleName, package: googleMobileAdsModuleName),
64+
.target(name: omModuleName),
65+
.target(name: teadsModuleName),
66+
.target(name: commonModuleName),
67+
],
68+
path: "\(mediationAdaptersDirectory)/\(teadsAdMobAdapterModuleName)"
69+
),
70+
.target(
71+
name: teadsAppLovinAdapterModuleName,
72+
dependencies: [
73+
.product(name: appLovinMaxModuleName, package: appLovinMaxModuleName),
74+
.target(name: omModuleName),
75+
.target(name: teadsModuleName),
76+
.target(name: commonModuleName),
77+
],
78+
path: "\(mediationAdaptersDirectory)/\(teadsAppLovinAdapterModuleName)"
79+
),
2880
]
2981
)

README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@
88

99
Teads allows you to integrate a single SDK into your app, and serve premium branded "outstream" video ads from Teads SSP ad server. This sample app includes Teads iOS framework and is showing integration examples.
1010

11-
12-
> **⚠️ Important ⚠️**
13-
>
14-
> ***Xcode 13***
15-
>
16-
> In Xcode 13, Apple introduced an option to override the version number of every plist present inside your app (https://developer.apple.com/forums/thread/690647). Even those from third parties frameworks like TeadsSDK. We used to rely on the plist to retrieve the TeadsSDK version. To prevent this, we changed the way we checked the SDK version since version 5.0.6. So please update your integration to at least version 5.0.6.
17-
1811
## 📋 Table of Contents
1912

2013
- [Integration Documentation](#-integration-documentation)
@@ -40,8 +33,6 @@ Clone this repository, open it with Xcode, and run project.
4033

4134
## 📦 Install the Teads SDK iOS framework
4235

43-
Teads SDK is currently distributed through CocoaPods. It includes everything you need to serve "outstream" video ads.
44-
4536
### Cocoapods
4637

4738
To install the TeadsSDK just put this on your podfile, if you've never used cocoapods before please check the [offical documentation](https://guides.cocoapods.org/using/using-cocoapods.html).
@@ -56,6 +47,7 @@ On your terminal, go to the directory containing your project's `.xcodeproj` fil
5647
pod install --repo-update
5748
```
5849

50+
Before installing Teads adapter, you need to implement [Google Mobile Ads](https://developers.google.com/admob/ios/quick-start) in your application.
5951

6052
### Swift Package Manager
6153

@@ -69,6 +61,7 @@ pod install --repo-update
6961
https://github.com/teads/TeadsSDK-iOS
7062
```
7163
3. Next, set the **Dependency Rule** to be `Up to Next Major Version` and keep `5.0.0 < 6.0.0`.
64+
4. Choose the Teads product that you want to be installed in your app: `TeadsSDK`
7265

7366
#### Alternatively, add Teads to your Package.swift manifest
7467
1. Add it to the `dependencies` of your `Package.swift`:
@@ -79,6 +72,18 @@ dependencies: [
7972
]
8073
```
8174

75+
2. in any target that depends on a Teads product, add it to the `dependencies` array of that target:
76+
77+
```swift
78+
.target(
79+
name: "MyTargetName",
80+
dependencies: [
81+
// The product(s) you want (e.g. TeadsSDK).
82+
.product(name: "TeadsSDK", package: "Teads"),
83+
]
84+
),
85+
```
86+
8287
## 🤝 Mediation Adapters
8388
- [Google AdMob](./MediationAdapters/TeadsAdMobAdapter/README.md)
8489
- [AppLovin Max](./MediationAdapters/TeadsAppLovinAdapter/README.md)
@@ -95,3 +100,4 @@ Teads SDK supports the [IAB](https://www.iabcertification.com/) [Open Measuremen
95100

96101
See [changelog here](https://github.com/teads/TeadsSDK-iOS/releases).
97102

103+
Integration instructions are available on [Teads SDK Documentation](https://support.teads.tv/support/solutions/articles/36000314767-inread-google-ad-manager-and-admob-mediation).

0 commit comments

Comments
 (0)