Skip to content

Commit 6ba6ec0

Browse files
committed
fix Admob adapter integration
1 parent 67ec0be commit 6ba6ec0

File tree

5 files changed

+58
-43
lines changed

5 files changed

+58
-43
lines changed

Podfile.lock

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,66 @@
11
PODS:
2-
- Google-Mobile-Ads-SDK (7.46.0):
2+
- Google-Mobile-Ads-SDK (7.59.0):
33
- GoogleAppMeasurement (~> 6.0)
4-
- GoogleAppMeasurement (6.0.2):
4+
- GoogleAppMeasurement (6.6.1):
55
- GoogleUtilities/AppDelegateSwizzler (~> 6.0)
66
- GoogleUtilities/MethodSwizzler (~> 6.0)
77
- GoogleUtilities/Network (~> 6.0)
88
- "GoogleUtilities/NSData+zlib (~> 6.0)"
9-
- nanopb (~> 0.3)
10-
- GoogleMobileAdsMediationTeads (4.2.6):
11-
- Google-Mobile-Ads-SDK (>= 7.31)
12-
- TeadsSDK (= 4.2.6)
13-
- GoogleUtilities/AppDelegateSwizzler (6.2.1):
9+
- nanopb (~> 1.30905.0)
10+
- GoogleMobileAdsMediationTeads (4.7.3):
11+
- Google-Mobile-Ads-SDK (>= 7.59)
12+
- TeadsSDK (= 4.7.3)
13+
- GoogleUtilities/AppDelegateSwizzler (6.6.0):
1414
- GoogleUtilities/Environment
1515
- GoogleUtilities/Logger
1616
- GoogleUtilities/Network
17-
- GoogleUtilities/Environment (6.2.1)
18-
- GoogleUtilities/Logger (6.2.1):
17+
- GoogleUtilities/Environment (6.6.0):
18+
- PromisesObjC (~> 1.2)
19+
- GoogleUtilities/Logger (6.6.0):
1920
- GoogleUtilities/Environment
20-
- GoogleUtilities/MethodSwizzler (6.2.1):
21+
- GoogleUtilities/MethodSwizzler (6.6.0):
2122
- GoogleUtilities/Logger
22-
- GoogleUtilities/Network (6.2.1):
23+
- GoogleUtilities/Network (6.6.0):
2324
- GoogleUtilities/Logger
2425
- "GoogleUtilities/NSData+zlib"
2526
- GoogleUtilities/Reachability
26-
- "GoogleUtilities/NSData+zlib (6.2.1)"
27-
- GoogleUtilities/Reachability (6.2.1):
27+
- "GoogleUtilities/NSData+zlib (6.6.0)"
28+
- GoogleUtilities/Reachability (6.6.0):
2829
- GoogleUtilities/Logger
29-
- nanopb (0.3.901):
30-
- nanopb/decode (= 0.3.901)
31-
- nanopb/encode (= 0.3.901)
32-
- nanopb/decode (0.3.901)
33-
- nanopb/encode (0.3.901)
34-
- TeadsSDK (4.2.6)
30+
- nanopb (1.30905.0):
31+
- nanopb/decode (= 1.30905.0)
32+
- nanopb/encode (= 1.30905.0)
33+
- nanopb/decode (1.30905.0)
34+
- nanopb/encode (1.30905.0)
35+
- PromisesObjC (1.2.9)
36+
- TeadsSDK (4.7.3)
3537

3638
DEPENDENCIES:
37-
- GoogleMobileAdsMediationTeads
39+
- Google-Mobile-Ads-SDK (= 7.59)
40+
- GoogleMobileAdsMediationTeads (from `~/dev/tmp/`)
3841

3942
SPEC REPOS:
40-
https://github.com/cocoapods/specs.git:
43+
trunk:
4144
- Google-Mobile-Ads-SDK
4245
- GoogleAppMeasurement
43-
- GoogleMobileAdsMediationTeads
4446
- GoogleUtilities
4547
- nanopb
48+
- PromisesObjC
4649
- TeadsSDK
4750

51+
EXTERNAL SOURCES:
52+
GoogleMobileAdsMediationTeads:
53+
:podspec: "~/dev/tmp/"
54+
4855
SPEC CHECKSUMS:
49-
Google-Mobile-Ads-SDK: 4bff3a7d621555f2317813e495fecce745681f7e
50-
GoogleAppMeasurement: a35a645835bae31b6bdc0576396bc23908f12a22
51-
GoogleMobileAdsMediationTeads: 93bc95b8cae17b0d82a180ce7fa0289c290814b3
52-
GoogleUtilities: c7a0b08bda3bf808be823ed151f0e28ac6866e71
53-
nanopb: 2901f78ea1b7b4015c860c2fdd1ea2fee1a18d48
54-
TeadsSDK: aaf92a5fc1ae5048b52d5eb3a6331ecd66de2240
56+
Google-Mobile-Ads-SDK: 118217ac8b80e28aabe0c00aedab1cd885857776
57+
GoogleAppMeasurement: 2fd5c5a56c069db635c8e7b92d4809a9591d0a69
58+
GoogleMobileAdsMediationTeads: 33dccd8942efe3382e7c742248d40ea4732335ba
59+
GoogleUtilities: 39530bc0ad980530298e9c4af8549e991fd033b1
60+
nanopb: c43f40fadfe79e8b8db116583945847910cbabc9
61+
PromisesObjC: b48e0338dbbac2207e611750777895f7a5811b75
62+
TeadsSDK: 11de6769b5dac69f9ef4d65754180e7e892a6bfd
5563

56-
PODFILE CHECKSUM: 0e0b3452e2e774c7c3b06ca3fdf0da9e25cd80cf
64+
PODFILE CHECKSUM: da14f669638f062b244e1601ad3b29a1f5723140
5765

58-
COCOAPODS: 1.7.1
66+
COCOAPODS: 1.9.3

TeadsDemoApp.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
B56102A11F84D24400E59C76 /* RandomCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RandomCollectionViewCell.swift; sourceTree = "<group>"; };
7575
B56102A31F84DB3000E59C76 /* TeadsAdEmbededCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeadsAdEmbededCollectionViewCell.swift; sourceTree = "<group>"; };
7676
B56102A81F853B0000E59C76 /* InReadTopViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InReadTopViewController.swift; sourceTree = "<group>"; };
77-
B5660B78207FAEA700406869 /* TeadsSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = TeadsSDK.framework; sourceTree = "<group>"; };
7877
B57FB1EA1FC5D5C600609036 /* images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = images.xcassets; sourceTree = "<group>"; };
7978
B57FB1EE1FC5E07E00609036 /* SettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewController.swift; sourceTree = "<group>"; };
8079
B57FB1F01FC5E21F00609036 /* PidTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PidTableViewCell.swift; sourceTree = "<group>"; };
@@ -99,7 +98,6 @@
9998
2592708B5E82C5A12C737F0B /* Frameworks */ = {
10099
isa = PBXGroup;
101100
children = (
102-
B5660B78207FAEA700406869 /* TeadsSDK.framework */,
103101
4B79512963E77F97E0E9430D /* Pods_TeadsDemoApp.framework */,
104102
);
105103
name = Frameworks;
@@ -467,15 +465,13 @@
467465
);
468466
inputPaths = (
469467
"${PODS_ROOT}/Target Support Files/Pods-TeadsDemoApp/Pods-TeadsDemoApp-frameworks.sh",
470-
"${PODS_ROOT}/GoogleMobileAdsMediationTeads/TeadsAdMobAdapter.framework",
471468
"${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework",
472469
"${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework",
473470
"${PODS_ROOT}/TeadsSDK/TeadsSDK.framework",
474471
"${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework",
475472
);
476473
name = "[CP] Embed Pods Frameworks";
477474
outputPaths = (
478-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TeadsAdMobAdapter.framework",
479475
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework",
480476
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework",
481477
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TeadsSDK.framework",
@@ -660,13 +656,15 @@
660656
baseConfigurationReference = 91867719F32F3DB45575394B /* Pods-TeadsDemoApp.debug.xcconfig */;
661657
buildSettings = {
662658
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
659+
BUNDLE_LOADER = "";
663660
CODE_SIGN_STYLE = Automatic;
664661
DEVELOPMENT_TEAM = V55UEG98F8;
665662
FRAMEWORK_SEARCH_PATHS = (
666663
"$(inherited)",
667664
"$(PROJECT_DIR)/TeadsDemoApp",
668665
"$(PROJECT_DIR)",
669666
);
667+
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
670668
INFOPLIST_FILE = TeadsDemoApp/Info.plist;
671669
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
672670
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@@ -682,13 +680,15 @@
682680
baseConfigurationReference = 48B8DFE05488E339B96E8286 /* Pods-TeadsDemoApp.release.xcconfig */;
683681
buildSettings = {
684682
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
683+
BUNDLE_LOADER = "";
685684
CODE_SIGN_STYLE = Automatic;
686685
DEVELOPMENT_TEAM = V55UEG98F8;
687686
FRAMEWORK_SEARCH_PATHS = (
688687
"$(inherited)",
689688
"$(PROJECT_DIR)/TeadsDemoApp",
690689
"$(PROJECT_DIR)",
691690
);
691+
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
692692
INFOPLIST_FILE = TeadsDemoApp/Info.plist;
693693
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
694694
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";

TeadsDemoApp/Controllers/adMobController/AdMobController.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import UIKit
1313
class AdMobController: UIViewController, GADBannerViewDelegate {
1414

1515
// FIXME This ids should be replaced by your own AdMob application and ad block/unit ids
16-
let ADMOB_AD_UNIT_ID = "ca-app-pub-3570580224725271/5615499706"
16+
let ADMOB_AD_UNIT_ID = "ca-app-pub-3940256099942544/2934735716"
1717

1818
var bannerView: GADBannerView!
1919
@IBOutlet weak var slotView: UIView!
@@ -49,7 +49,11 @@ class AdMobController: UIViewController, GADBannerViewDelegate {
4949
//settings.pageUrl("http://page.com/article1")
5050
}
5151

52-
request.register(teadsAdSettings: adSettings, for: "Teads")
52+
let extras = try? adSettings.toDictionary()
53+
let customEventExtras = GADCustomEventExtras()
54+
customEventExtras.setExtras(extras, forLabel: "Teads")
55+
56+
request.register(customEventExtras)
5357

5458
bannerView.load(request)
5559
}

TeadsDemoApp/Controllers/adMobController/AdMobInWebViewController.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class AdMobInWebViewController: UIViewController, WKNavigationDelegate, GADBanne
1919
var bannerView: GADBannerView!
2020

2121
// FIXME This ids should be replaced by your own AdMob application and ad block/unit ids
22-
let ADMOB_AD_UNIT_ID = "ca-app-pub-3570580224725271/5615499706"
22+
let ADMOB_AD_UNIT_ID = "ca-app-pub-3940256099942544/2934735716"
2323

2424
private var currentBanner: GADBannerView!
2525
override func viewDidLoad() {
@@ -47,7 +47,11 @@ class AdMobInWebViewController: UIViewController, WKNavigationDelegate, GADBanne
4747
//settings.pageUrl("http://page.com/article1")
4848
}
4949

50-
request.register(teadsAdSettings: adSettings, for: "Teads")
50+
let extras = try? adSettings.toDictionary()
51+
let customEventExtras = GADCustomEventExtras()
52+
customEventExtras.setExtras(extras, forLabel: "Teads")
53+
54+
request.register(customEventExtras)
5155

5256
self.bannerView.load(request)
5357
self.webSync = SyncWebViewAdView(webView: self.webView, selector: "#my-placement-id", adView: self.bannerView)

TeadsDemoApp/Info.plist

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5-
<key>GADIsAdManagerApp</key>
6-
<true/>
7-
<key>GADApplicationIdentifier</key>
8-
<string>ca-app-pub-3570580224725271~8055914490</string>
5+
<key>GADIsAdManagerApp</key>
6+
<true/>
7+
<key>GADApplicationIdentifier</key>
8+
<string>ca-app-pub-3940256099942544~1458002511</string>
99
<key>CFBundleDevelopmentRegion</key>
1010
<string>$(DEVELOPMENT_LANGUAGE)</string>
1111
<key>CFBundleExecutable</key>
@@ -50,6 +50,5 @@
5050
<key>NSAllowsArbitraryLoads</key>
5151
<true/>
5252
</dict>
53-
5453
</dict>
5554
</plist>

0 commit comments

Comments
 (0)