Skip to content

Commit 8d6132c

Browse files
committed
rename @objc MAAdapterTeadsMediation to TeadsMediationAdapter
1 parent 40536e1 commit 8d6132c

File tree

8 files changed

+17
-28
lines changed

8 files changed

+17
-28
lines changed

MediationAdapters/TeadsAppLovinAdapter/TeadsMediationAdapter.swift

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
2-
// MAAdapterTeadsMediation.swift
3-
// TeadsAdMobAdapter
2+
// TeadsMediationAdapter.swift
3+
// TeadsAppLovinAdapter
44
//
55
// Created by Paul Nicolas on 15/02/2022.
66
//
@@ -9,10 +9,8 @@ import UIKit
99
import AppLovinSDK
1010
import TeadsSDK
1111

12-
@objc(MAAdapterTeadsMediation)
12+
@objc(TeadsMediationAdapter)
1313
final class TeadsMediationAdapter: ALMediationAdapter {
14-
var parameters: MAAdapterInitializationParameters!
15-
1614
var currentNativePlacement: TeadsNativeAdPlacement?
1715
weak var nativeDelegate: MANativeAdAdapterDelegate?
1816

@@ -21,7 +19,6 @@ final class TeadsMediationAdapter: ALMediationAdapter {
2119
weak var currentAdView: TeadsInReadAdView?
2220

2321
@objc override func initialize(with parameters: MAAdapterInitializationParameters, completionHandler: @escaping (MAAdapterInitializationStatus, String?) -> Void) {
24-
self.parameters = parameters
2522
Teads.configure()
2623
completionHandler(.doesNotApply, nil)
2724
}
@@ -39,7 +36,7 @@ final class TeadsMediationAdapter: ALMediationAdapter {
3936
}
4037

4138
override func destroy() {
42-
39+
4340
}
4441
}
4542

@@ -70,7 +67,7 @@ final class TeadsMediationAdapter: ALMediationAdapter {
7067

7168
// Prepare ad settings
7269
let adSettings = (try? TeadsAdapterSettings.instance(fromAppLovinParameters: parameters.localExtraParameters)) ?? TeadsAdapterSettings()
73-
70+
7471
// Load inRead ad
7572
currentInReadPlacement = Teads.createInReadPlacement(pid: pid, settings: adSettings.adPlacementSettings, delegate: self)
7673
currentInReadPlacement?.requestAd(requestSettings: adSettings.adRequestSettings)
@@ -87,7 +84,6 @@ extension TeadsMediationAdapter: TeadsInReadAdPlacementDelegate {
8784
func didUpdateRatio(ad: TeadsInReadAd, adRatio: TeadsAdRatio) {
8885
currentAdView?.updateHeight(with: adRatio)
8986
}
90-
9187
}
9288

9389
extension TeadsMediationAdapter: TeadsNativeAdPlacementDelegate {
@@ -128,7 +124,6 @@ extension TeadsMediationAdapter: TeadsNativeAdPlacementDelegate {
128124
func adOpportunityTrackerView(trackerView: TeadsAdOpportunityTrackerView) {
129125
// adOpportunityTrackerView is handled by TeadsSDK
130126
}
131-
132127
}
133128

134129
extension TeadsMediationAdapter: TeadsAdDelegate {

MediationAdapters/TeadsAppLovinAdapter/MAAdapterTeadsExtension.swift renamed to MediationAdapters/TeadsAppLovinAdapter/TeadsMediationAdapterExtension.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// MAAdapterTeadsExtension.swift
3-
// TeadsAdMobAdapter
3+
// TeadsAppLovinAdapter
44
//
55
// Created by Paul Nicolas on 15/02/2022.
66
//

TeadsSampleApp.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@
796796
);
797797
inputPaths = (
798798
"${PODS_ROOT}/Target Support Files/Pods-TeadsSampleApp/Pods-TeadsSampleApp-resources.sh",
799-
"${PODS_ROOT}/AppLovinSDK/applovin-ios-sdk-11.1.1/AppLovinSDKResources.bundle",
799+
"${PODS_ROOT}/AppLovinSDK/applovin-ios-sdk-11.1.2/AppLovinSDKResources.bundle",
800800
);
801801
name = "[CP] Copy Pods Resources";
802802
outputPaths = (

TeadsSampleApp/Controllers/InRead/Admob/ScrollView/InReadAdmobScrollViewController.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class InReadAdmobScrollViewController: TeadsViewController {
3535
// 3. Load a new ad (this will call AdMob and Teads afterward)
3636
let adSettings = TeadsAdapterSettings { (settings) in
3737
settings.enableDebug()
38-
settings.disableLocation()
3938
try? settings.registerAdView(bannerView, delegate: self)
4039
// Needed by european regulation
4140
// See https://mobile.teads.tv/sdk/documentation/ios/gdpr-consent

TeadsSampleApp/Controllers/InRead/Admob/TableView/InReadAdmobTableViewController.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ class InReadAdmobTableViewController: TeadsViewController {
4242
// 3. Load a new ad (this will call AdMob and Teads afterward)
4343
let adSettings = TeadsAdapterSettings { (settings) in
4444
settings.enableDebug()
45-
settings.disableLocation()
4645
if let admobAdView = admobAdView {
4746
try? settings.registerAdView(admobAdView, delegate: self)
4847
}

TeadsSampleApp/Controllers/InRead/AppLovin/ScrollView/InReadAppLovinScrollViewController.swift

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,17 @@ class InReadAppLovinScrollViewController: TeadsViewController {
2222
override func viewDidLoad() {
2323
super.viewDidLoad()
2424

25-
ALSdk.shared()?.mediationProvider = "MAAdapterTeadsMediation"
25+
ALSdk.shared()?.mediationProvider = ALMediationProviderMAX
26+
ALSdk.shared()!.settings.isVerboseLogging = true
2627
ALSdk.shared()!.initializeSdk { [weak self] (configuration: ALSdkConfiguration) in
2728
self?.loadAd()
2829
}
2930
}
3031

3132
func loadAd() {
3233
// FIXME This ids should be replaced by your own AppLovin AdUnitId
33-
let APPLOVIN_AD_UNIT_ID = "ebe5409dd16b929d" //TODO replace by self.pid
34-
bannerView = MAAdView(adUnitIdentifier: APPLOVIN_AD_UNIT_ID)
34+
let APPLOVIN_AD_UNIT_ID = "33d03d37d70196e3" //TODO replace by self.pid
35+
bannerView = MAAdView(adUnitIdentifier: APPLOVIN_AD_UNIT_ID, adFormat: .mrec)
3536
bannerView.stopAutoRefresh()
3637

3738
let settings = TeadsAdapterSettings { (settings) in
@@ -41,13 +42,7 @@ class InReadAppLovinScrollViewController: TeadsViewController {
4142
}
4243
bannerView.register(teadsAdSettings: settings)
4344

44-
// Banner height on iPhone and iPad is 50 and 90, respectively
45-
let height: CGFloat = (UIDevice.current.userInterfaceIdiom == .pad) ? 90 : 50
46-
47-
// Stretch to the width of the screen for banners to be fully functional
48-
let width: CGFloat = UIScreen.main.bounds.width
49-
50-
bannerView.frame = CGRect(x: 0, y: 0, width: width, height: height)
45+
bannerView.frame = CGRect(x: 0, y: 0, width: view.frame.width, height: 250)
5146

5247
// Set background or background color for banners to be fully functional
5348
bannerView.backgroundColor = .clear

TeadsSampleApp/Controllers/Native/AppLovin/TableView/NativeAppLovinTableViewController.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,16 @@ class NativeAppLovinTableViewController: TeadsViewController {
3030
elements.append(nil)
3131
}
3232

33-
ALSdk.shared()?.mediationProvider = "MAAdapterTeadsMediation"
33+
ALSdk.shared()?.mediationProvider = ALMediationProviderMAX
34+
ALSdk.shared()!.settings.isVerboseLogging = true
3435
ALSdk.shared()!.initializeSdk { [weak self] (configuration: ALSdkConfiguration) in
3536
self?.loadAd()
3637
}
37-
}
38+
}
3839

3940
func loadAd() {
4041
// FIXME This ids should be replaced by your own AppLovin AdUnitId
41-
let APPLOVIN_AD_UNIT_ID = "ebe5409dd16b929d" //TODO replace by self.pid
42+
let APPLOVIN_AD_UNIT_ID = "b87480e23dd55a79" //TODO replace by self.pid
4243
nativeAdLoader = MANativeAdLoader(adUnitIdentifier: APPLOVIN_AD_UNIT_ID)
4344

4445
// Setting the modal parent view controller.

TeadsSampleApp/Models/Format.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ struct PID {
150150
static let sasSquare = "96468"
151151
static let sasCarousel = "96470"
152152

153-
static let appLovinLandscape = "ebe5409dd16b929d"
153+
static let appLovinLandscape = "33d03d37d70196e3"
154154
static let appLovinVertical = "808eaa38d08ade2d"
155155
static let appLovinSquare = "f83b5fc30c17954e"
156156
static let appLovinCarousel = "21c6dc998b472d8d"

0 commit comments

Comments
 (0)