Skip to content

Commit 5f0be5f

Browse files
committed
fix mopub loadAd
update package.swift
1 parent 241f66d commit 5f0be5f

File tree

4 files changed

+12
-15
lines changed

4 files changed

+12
-15
lines changed

Package.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ let omModuleName = "OMSDK_Teadstv"
88
let package = Package(
99
name: teadsModuleName,
1010
platforms: [
11-
.iOS(.v9)
11+
.iOS(.v10)
1212
],
1313
products: [
1414
.library(
@@ -19,11 +19,11 @@ let package = Package(
1919
targets: [
2020
.binaryTarget(
2121
name: teadsModuleName,
22-
path: "\(teadsModuleName).xcframework"
22+
path: "Frameworks/\(teadsModuleName).xcframework"
2323
),
2424
.binaryTarget(
2525
name: omModuleName,
26-
path: "\(omModuleName).xcframework"
26+
path: "Frameworks/\(omModuleName).xcframework"
2727
),
2828

2929
]

TeadsSampleApp/Controllers/InRead/Mopub/ScrollView/InReadMopubScrollViewController.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,8 @@ class InReadMopubScrollViewController: TeadsViewController {
3737
}
3838

3939
MoPub.sharedInstance().initializeSdk(with: config) { [weak self] in
40-
41-
guard let weakSelf = self else {
42-
return
43-
}
4440
DispatchQueue.main.async {
45-
weakSelf.loadAd()
41+
self?.loadAd()
4642
}
4743
}
4844
}

TeadsSampleApp/Controllers/InRead/Mopub/TableView/InReadMopubTableViewController.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,8 @@ class InReadMopubTableViewController: TeadsViewController {
4444
}
4545

4646
MoPub.sharedInstance().initializeSdk(with: config) { [weak self] in
47-
48-
guard let weakSelf = self else {
49-
return
50-
}
5147
DispatchQueue.main.async {
52-
weakSelf.loadAd()
48+
self?.loadAd()
5349
}
5450
}
5551
}

TeadsSampleApp/Controllers/Native/Mopub/TableView/NativeMopubTableViewController.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,13 @@ class NativeMopubTableViewController: TeadsViewController {
3737

3838
let mpConfig = MPMoPubConfiguration(adUnitIdForAppInitialization: pid)
3939
mpConfig.loggingLevel = .debug
40-
MoPub.sharedInstance().initializeSdk(with: mpConfig) {
41-
self.loadAd()
40+
41+
if MoPub.sharedInstance().isSdkInitialized {
42+
loadAd()
43+
}
44+
45+
MoPub.sharedInstance().initializeSdk(with: mpConfig) { [weak self] in
46+
self?.loadAd()
4247
}
4348
}
4449

0 commit comments

Comments
 (0)