Skip to content

Commit

Permalink
fix Admob adapter integration
Browse files Browse the repository at this point in the history
  • Loading branch information
elneruda committed Jul 1, 2020
1 parent 67ec0be commit 6ba6ec0
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 43 deletions.
68 changes: 38 additions & 30 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,58 +1,66 @@
PODS:
- Google-Mobile-Ads-SDK (7.46.0):
- Google-Mobile-Ads-SDK (7.59.0):
- GoogleAppMeasurement (~> 6.0)
- GoogleAppMeasurement (6.0.2):
- GoogleAppMeasurement (6.6.1):
- GoogleUtilities/AppDelegateSwizzler (~> 6.0)
- GoogleUtilities/MethodSwizzler (~> 6.0)
- GoogleUtilities/Network (~> 6.0)
- "GoogleUtilities/NSData+zlib (~> 6.0)"
- nanopb (~> 0.3)
- GoogleMobileAdsMediationTeads (4.2.6):
- Google-Mobile-Ads-SDK (>= 7.31)
- TeadsSDK (= 4.2.6)
- GoogleUtilities/AppDelegateSwizzler (6.2.1):
- nanopb (~> 1.30905.0)
- GoogleMobileAdsMediationTeads (4.7.3):
- Google-Mobile-Ads-SDK (>= 7.59)
- TeadsSDK (= 4.7.3)
- GoogleUtilities/AppDelegateSwizzler (6.6.0):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
- GoogleUtilities/Network
- GoogleUtilities/Environment (6.2.1)
- GoogleUtilities/Logger (6.2.1):
- GoogleUtilities/Environment (6.6.0):
- PromisesObjC (~> 1.2)
- GoogleUtilities/Logger (6.6.0):
- GoogleUtilities/Environment
- GoogleUtilities/MethodSwizzler (6.2.1):
- GoogleUtilities/MethodSwizzler (6.6.0):
- GoogleUtilities/Logger
- GoogleUtilities/Network (6.2.1):
- GoogleUtilities/Network (6.6.0):
- GoogleUtilities/Logger
- "GoogleUtilities/NSData+zlib"
- GoogleUtilities/Reachability
- "GoogleUtilities/NSData+zlib (6.2.1)"
- GoogleUtilities/Reachability (6.2.1):
- "GoogleUtilities/NSData+zlib (6.6.0)"
- GoogleUtilities/Reachability (6.6.0):
- GoogleUtilities/Logger
- nanopb (0.3.901):
- nanopb/decode (= 0.3.901)
- nanopb/encode (= 0.3.901)
- nanopb/decode (0.3.901)
- nanopb/encode (0.3.901)
- TeadsSDK (4.2.6)
- nanopb (1.30905.0):
- nanopb/decode (= 1.30905.0)
- nanopb/encode (= 1.30905.0)
- nanopb/decode (1.30905.0)
- nanopb/encode (1.30905.0)
- PromisesObjC (1.2.9)
- TeadsSDK (4.7.3)

DEPENDENCIES:
- GoogleMobileAdsMediationTeads
- Google-Mobile-Ads-SDK (= 7.59)
- GoogleMobileAdsMediationTeads (from `~/dev/tmp/`)

SPEC REPOS:
https://github.com/cocoapods/specs.git:
trunk:
- Google-Mobile-Ads-SDK
- GoogleAppMeasurement
- GoogleMobileAdsMediationTeads
- GoogleUtilities
- nanopb
- PromisesObjC
- TeadsSDK

EXTERNAL SOURCES:
GoogleMobileAdsMediationTeads:
:podspec: "~/dev/tmp/"

SPEC CHECKSUMS:
Google-Mobile-Ads-SDK: 4bff3a7d621555f2317813e495fecce745681f7e
GoogleAppMeasurement: a35a645835bae31b6bdc0576396bc23908f12a22
GoogleMobileAdsMediationTeads: 93bc95b8cae17b0d82a180ce7fa0289c290814b3
GoogleUtilities: c7a0b08bda3bf808be823ed151f0e28ac6866e71
nanopb: 2901f78ea1b7b4015c860c2fdd1ea2fee1a18d48
TeadsSDK: aaf92a5fc1ae5048b52d5eb3a6331ecd66de2240
Google-Mobile-Ads-SDK: 118217ac8b80e28aabe0c00aedab1cd885857776
GoogleAppMeasurement: 2fd5c5a56c069db635c8e7b92d4809a9591d0a69
GoogleMobileAdsMediationTeads: 33dccd8942efe3382e7c742248d40ea4732335ba
GoogleUtilities: 39530bc0ad980530298e9c4af8549e991fd033b1
nanopb: c43f40fadfe79e8b8db116583945847910cbabc9
PromisesObjC: b48e0338dbbac2207e611750777895f7a5811b75
TeadsSDK: 11de6769b5dac69f9ef4d65754180e7e892a6bfd

PODFILE CHECKSUM: 0e0b3452e2e774c7c3b06ca3fdf0da9e25cd80cf
PODFILE CHECKSUM: da14f669638f062b244e1601ad3b29a1f5723140

COCOAPODS: 1.7.1
COCOAPODS: 1.9.3
8 changes: 4 additions & 4 deletions TeadsDemoApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
B56102A11F84D24400E59C76 /* RandomCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RandomCollectionViewCell.swift; sourceTree = "<group>"; };
B56102A31F84DB3000E59C76 /* TeadsAdEmbededCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeadsAdEmbededCollectionViewCell.swift; sourceTree = "<group>"; };
B56102A81F853B0000E59C76 /* InReadTopViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InReadTopViewController.swift; sourceTree = "<group>"; };
B5660B78207FAEA700406869 /* TeadsSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = TeadsSDK.framework; sourceTree = "<group>"; };
B57FB1EA1FC5D5C600609036 /* images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = images.xcassets; sourceTree = "<group>"; };
B57FB1EE1FC5E07E00609036 /* SettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewController.swift; sourceTree = "<group>"; };
B57FB1F01FC5E21F00609036 /* PidTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PidTableViewCell.swift; sourceTree = "<group>"; };
Expand All @@ -99,7 +98,6 @@
2592708B5E82C5A12C737F0B /* Frameworks */ = {
isa = PBXGroup;
children = (
B5660B78207FAEA700406869 /* TeadsSDK.framework */,
4B79512963E77F97E0E9430D /* Pods_TeadsDemoApp.framework */,
);
name = Frameworks;
Expand Down Expand Up @@ -467,15 +465,13 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-TeadsDemoApp/Pods-TeadsDemoApp-frameworks.sh",
"${PODS_ROOT}/GoogleMobileAdsMediationTeads/TeadsAdMobAdapter.framework",
"${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework",
"${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework",
"${PODS_ROOT}/TeadsSDK/TeadsSDK.framework",
"${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TeadsAdMobAdapter.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TeadsSDK.framework",
Expand Down Expand Up @@ -660,13 +656,15 @@
baseConfigurationReference = 91867719F32F3DB45575394B /* Pods-TeadsDemoApp.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
BUNDLE_LOADER = "";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = V55UEG98F8;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/TeadsDemoApp",
"$(PROJECT_DIR)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
INFOPLIST_FILE = TeadsDemoApp/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -682,13 +680,15 @@
baseConfigurationReference = 48B8DFE05488E339B96E8286 /* Pods-TeadsDemoApp.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
BUNDLE_LOADER = "";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = V55UEG98F8;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/TeadsDemoApp",
"$(PROJECT_DIR)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
INFOPLIST_FILE = TeadsDemoApp/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import UIKit
class AdMobController: UIViewController, GADBannerViewDelegate {

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

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

request.register(teadsAdSettings: adSettings, for: "Teads")
let extras = try? adSettings.toDictionary()
let customEventExtras = GADCustomEventExtras()
customEventExtras.setExtras(extras, forLabel: "Teads")

request.register(customEventExtras)

bannerView.load(request)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class AdMobInWebViewController: UIViewController, WKNavigationDelegate, GADBanne
var bannerView: GADBannerView!

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

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

request.register(teadsAdSettings: adSettings, for: "Teads")
let extras = try? adSettings.toDictionary()
let customEventExtras = GADCustomEventExtras()
customEventExtras.setExtras(extras, forLabel: "Teads")

request.register(customEventExtras)

self.bannerView.load(request)
self.webSync = SyncWebViewAdView(webView: self.webView, selector: "#my-placement-id", adView: self.bannerView)
Expand Down
9 changes: 4 additions & 5 deletions TeadsDemoApp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>GADIsAdManagerApp</key>
<true/>
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-3570580224725271~8055914490</string>
<key>GADIsAdManagerApp</key>
<true/>
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-3940256099942544~1458002511</string>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
Expand Down Expand Up @@ -50,6 +50,5 @@
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>

</dict>
</plist>

0 comments on commit 6ba6ec0

Please sign in to comment.