From 5638885c4fe05b899850312d92a643adb1ff1c21 Mon Sep 17 00:00:00 2001 From: Olena Stepaniuk Date: Mon, 23 Dec 2024 15:58:13 +0200 Subject: [PATCH 1/3] feat: add GAM test case --- .../InternalTestApp.xcodeproj/project.pbxproj | 6 + .../AppDelegate.swift | 2 + .../Model/TestCasesManager.swift | 19 +++ .../Resources/Info.plist | 13 ++ ...niversalCreativeTestingGAMController.swift | 128 ++++++++++++++++++ 5 files changed, 168 insertions(+) create mode 100644 InternalTestApp/PrebidMobileDemoRendering/ViewControllers/Adapters/Prebid/OriginalAPI/PrebidUniversalCreativeTestingGAMController.swift diff --git a/InternalTestApp/InternalTestApp.xcodeproj/project.pbxproj b/InternalTestApp/InternalTestApp.xcodeproj/project.pbxproj index 9b7ee2550..faa62309e 100644 --- a/InternalTestApp/InternalTestApp.xcodeproj/project.pbxproj +++ b/InternalTestApp/InternalTestApp.xcodeproj/project.pbxproj @@ -31,6 +31,8 @@ 3CC4A3EA2C11F96800B97128 /* CustomRendererBannerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CC4A3E82C11F96800B97128 /* CustomRendererBannerController.swift */; }; 457FD34BA45C3840CC31A8F5 /* Pods_InternalTestApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C11D97034E668BBFDD0DDCA /* Pods_InternalTestApp.framework */; }; 530E722C292FACB20025B44D /* UIImageView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 530E722B292FACB20025B44D /* UIImageView+Extensions.swift */; }; + 535ADDFB2D19731000DB888F /* PrebidUniversalCreativeTestingGAMController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 535ADDFA2D19731000DB888F /* PrebidUniversalCreativeTestingGAMController.swift */; }; + 535ADDFC2D19731000DB888F /* PrebidUniversalCreativeTestingGAMController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 535ADDFA2D19731000DB888F /* PrebidUniversalCreativeTestingGAMController.swift */; }; 5397BD142936185400ABDA22 /* PrebidOriginalAPIDisplayBannerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5397BD132936185400ABDA22 /* PrebidOriginalAPIDisplayBannerController.swift */; }; 5397BD26293760F500ABDA22 /* PrebidOriginalAPIDisplayInterstitialController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5397BD25293760F500ABDA22 /* PrebidOriginalAPIDisplayInterstitialController.swift */; }; 5397BD2A29376C9700ABDA22 /* PrebidOriginalAPIVideoRewardedController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5397BD2929376C9700ABDA22 /* PrebidOriginalAPIVideoRewardedController.swift */; }; @@ -381,6 +383,7 @@ 3C28C9D72C35713B00D0A7DB /* CustomRendererInterstitialController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomRendererInterstitialController.swift; sourceTree = ""; }; 3CC4A3E82C11F96800B97128 /* CustomRendererBannerController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomRendererBannerController.swift; sourceTree = ""; }; 530E722B292FACB20025B44D /* UIImageView+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImageView+Extensions.swift"; sourceTree = ""; }; + 535ADDFA2D19731000DB888F /* PrebidUniversalCreativeTestingGAMController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrebidUniversalCreativeTestingGAMController.swift; sourceTree = ""; }; 5397BD132936185400ABDA22 /* PrebidOriginalAPIDisplayBannerController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrebidOriginalAPIDisplayBannerController.swift; sourceTree = ""; }; 5397BD25293760F500ABDA22 /* PrebidOriginalAPIDisplayInterstitialController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrebidOriginalAPIDisplayInterstitialController.swift; sourceTree = ""; }; 5397BD2929376C9700ABDA22 /* PrebidOriginalAPIVideoRewardedController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrebidOriginalAPIVideoRewardedController.swift; sourceTree = ""; }; @@ -722,6 +725,7 @@ 5397BD312937895700ABDA22 /* PrebidOriginalAPIVideoInstreamViewController.swift */, 539F961329DEF2670061E7A5 /* PrebidOriginalAPIVideoInterstitialController.swift */, 5397BD2929376C9700ABDA22 /* PrebidOriginalAPIVideoRewardedController.swift */, + 535ADDFA2D19731000DB888F /* PrebidUniversalCreativeTestingGAMController.swift */, ); path = OriginalAPI; sourceTree = ""; @@ -1610,6 +1614,7 @@ 53ED300B29798104007D13EE /* PrebidMAXInterstitialController.swift in Sources */, 53ED300C29798104007D13EE /* DummyTableViewCell.swift in Sources */, 53ED300D29798104007D13EE /* AboutViewController.swift in Sources */, + 535ADDFC2D19731000DB888F /* PrebidUniversalCreativeTestingGAMController.swift in Sources */, 53ED300E29798104007D13EE /* NativeAdViewBoxProtocol.swift in Sources */, 53ED300F29798104007D13EE /* FormViewController+RowBuildHelpers.swift in Sources */, 53ED301029798104007D13EE /* PrebidGAMBannerController.swift in Sources */, @@ -1706,6 +1711,7 @@ 92221CE12804AF5B005DF671 /* PrebidMAXInterstitialController.swift in Sources */, 5B8EB5EF22676914003CC15C /* DummyTableViewCell.swift in Sources */, 5B3EEDCB2101D1AF00BAA0C4 /* AboutViewController.swift in Sources */, + 535ADDFB2D19731000DB888F /* PrebidUniversalCreativeTestingGAMController.swift in Sources */, 92F9A5D127A15BD1007B0B17 /* NativeAdViewBoxProtocol.swift in Sources */, 341CC3142562C9D000186F29 /* FormViewController+RowBuildHelpers.swift in Sources */, 3493021C2473F408004A6086 /* PrebidGAMBannerController.swift in Sources */, diff --git a/InternalTestApp/PrebidMobileDemoRendering/AppDelegate.swift b/InternalTestApp/PrebidMobileDemoRendering/AppDelegate.swift index c4c076b6a..1b46f832e 100644 --- a/InternalTestApp/PrebidMobileDemoRendering/AppDelegate.swift +++ b/InternalTestApp/PrebidMobileDemoRendering/AppDelegate.swift @@ -183,4 +183,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } + + } diff --git a/InternalTestApp/PrebidMobileDemoRendering/Model/TestCasesManager.swift b/InternalTestApp/PrebidMobileDemoRendering/Model/TestCasesManager.swift index f05b106ae..a78f08315 100644 --- a/InternalTestApp/PrebidMobileDemoRendering/Model/TestCasesManager.swift +++ b/InternalTestApp/PrebidMobileDemoRendering/Model/TestCasesManager.swift @@ -467,6 +467,25 @@ struct TestCaseManager { setupCustomParams(for: interstitialController.prebidConfigId) }), + + // MARK: ---- Prebid Universal Creative Tests + + TestCase(title: "Prebid Universal Creative (GAM)", + tags: [.banner, .originalAPI, .server], + exampleVCStoryboardID: "AdapterViewController", + configurationClosure: { vc in + guard let adapterVC = vc as? AdapterViewController else { + return + } + + let bannerController = PrebidUniversalCreativeTestingGAMController(rootController: adapterVC) + bannerController.adSize = CGSize(width: 300, height: 250) + bannerController.gamAdUnitID = "/21808260008/prebid_puc_testing" + + adapterVC.setup(adapter: bannerController) + setupCustomParams(for: bannerController.prebidConfigId) + }), + // MARK: ---- Native (Original API) TestCase(title: "Native Banner (GAM Original) [OK, PUC]", diff --git a/InternalTestApp/PrebidMobileDemoRendering/Resources/Info.plist b/InternalTestApp/PrebidMobileDemoRendering/Resources/Info.plist index 7e4d40308..8869d27d5 100644 --- a/InternalTestApp/PrebidMobileDemoRendering/Resources/Info.plist +++ b/InternalTestApp/PrebidMobileDemoRendering/Resources/Info.plist @@ -35,8 +35,21 @@ NSAppTransportSecurity + NSAllowsArbitraryLoadsInWebContent + NSAllowsArbitraryLoads + NSAppTransportSecurity + + NSExceptionDomains + + 192.168.0.102 + + NSExceptionAllowsInsecureHTTPLoads + + + + NSLocationAlwaysUsageDescription Access to GPS is needed for testing purposes. diff --git a/InternalTestApp/PrebidMobileDemoRendering/ViewControllers/Adapters/Prebid/OriginalAPI/PrebidUniversalCreativeTestingGAMController.swift b/InternalTestApp/PrebidMobileDemoRendering/ViewControllers/Adapters/Prebid/OriginalAPI/PrebidUniversalCreativeTestingGAMController.swift new file mode 100644 index 000000000..76dd53721 --- /dev/null +++ b/InternalTestApp/PrebidMobileDemoRendering/ViewControllers/Adapters/Prebid/OriginalAPI/PrebidUniversalCreativeTestingGAMController.swift @@ -0,0 +1,128 @@ +/*   Copyright 2018-2024 Prebid.org, Inc. + +  Licensed under the Apache License, Version 2.0 (the "License"); +  you may not use this file except in compliance with the License. +  You may obtain a copy of the License at + +  http://www.apache.org/licenses/LICENSE-2.0 + +  Unless required by applicable law or agreed to in writing, software +  distributed under the License is distributed on an "AS IS" BASIS, +  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +  See the License for the specific language governing permissions and +  limitations under the License. +  */ + +import GoogleMobileAds + +final class PrebidUniversalCreativeTestingGAMController: + NSObject, + AdaptedController, + PrebidConfigurableBannerController, + GADBannerViewDelegate, WKNavigationDelegate { + + var refreshInterval: TimeInterval = 0 + var prebidConfigId: String = "" + var gamAdUnitID: String = "" + var adSize = CGSize.zero + + let rootController: AdapterViewController + + private var gamBanner: GAMBannerView! + + private let configIdLabel = UILabel() + private let reloadButton = ThreadCheckingButton() + + init(rootController: AdapterViewController) { + self.rootController = rootController + super.init() + + setupAdapterController() + } + + func configurationController() -> BaseConfigurationController? { + return PrebidBannerConfigurationController(controller: self) + } + + private func setupAdapterController() { + rootController.showButton.isHidden = true + + configIdLabel.isHidden = true + rootController.actionsView.addArrangedSubview(configIdLabel) + + reloadButton.addTarget(self, action: #selector(reload), for: .touchUpInside) + } + + func loadAd() { + configIdLabel.isHidden = false + configIdLabel.text = "GAM AdUnit ID: \(gamAdUnitID)" + + gamBanner = GAMBannerView(adSize: GADAdSizeFromCGSize(adSize)) + gamBanner.adUnitID = gamAdUnitID + gamBanner.rootViewController = rootController + gamBanner.delegate = self + + rootController.bannerView?.addSubview(gamBanner) + + let gamRequest = GAMRequest() + gamBanner.load(gamRequest) + } + + @objc private func reload() { + reloadButton.isEnabled = false + let gamRequest = GAMRequest() + gamBanner.load(gamRequest) + } + + func bannerViewDidReceiveAd(_ bannerView: GADBannerView) { + rootController.bannerView.backgroundColor = .clear + reloadButton.isEnabled = true + rootController.bannerView.constraints.first { $0.firstAttribute == .width }?.constant = 300 + rootController.bannerView.constraints.first { $0.firstAttribute == .height }?.constant = 500 + + let targetWebView = bannerView.allSubViewsOf(type: WKWebView.self).first + + if #available(iOS 14.0, *) { + targetWebView?.configuration.defaultWebpagePreferences.allowsContentJavaScript = true + } else { + targetWebView?.configuration.preferences.javaScriptEnabled = true + } + + targetWebView?.navigationDelegate = self + +// let js = """ +// function loadNewIframe() { +// // The URL to load in the iframe +// const iframeUrl = "http://192.168.0.102:9876"; // You can change this dynamically +// +// // Create the iframe element +// const iframe = document.createElement("iframe"); +// iframe.src = iframeUrl; +// +// // Optional: Set other attributes like width, height, and frameBorder +// iframe.width = "100%"; +// iframe.height = "400px"; +// iframe.frameBorder = "0"; // Removes the border of the iframe +// +// // Append the iframe to the end of the body +// document.body.appendChild(iframe); +// } +// +// // Call the function to load the iframe (you can bind this to a button or another event) +// loadNewIframe(); +// """ +// +// targetWebView?.evaluateJavaScript(js) + +// targetWebView?.load(URLRequest(url: URL(string: "http://192.168.0.102:9876")!)) + } + + func bannerView(_ bannerView: GADBannerView, didFailToReceiveAdWithError error: any Error) { + print(error.localizedDescription) + } + + + + + +} From 57dc0d08380d41442eebf5ab6a18f4f7e01cad68 Mon Sep 17 00:00:00 2001 From: Olena Stepaniuk Date: Mon, 23 Dec 2024 16:24:10 +0200 Subject: [PATCH 2/3] feat: add web view test case --- .../InternalTestApp.xcodeproj/project.pbxproj | 6 ++ .../Model/TestCasesManager.swift | 5 ++ .../Resources/Base.lproj/Main.storyboard | 66 ++++++++++++++++++- ...rsalCreativeTestingWebViewController.swift | 32 +++++++++ 4 files changed, 107 insertions(+), 2 deletions(-) create mode 100644 InternalTestApp/PrebidMobileDemoRendering/ViewControllers/Adapters/Prebid/OriginalAPI/PrebidUniversalCreativeTestingWebViewController.swift diff --git a/InternalTestApp/InternalTestApp.xcodeproj/project.pbxproj b/InternalTestApp/InternalTestApp.xcodeproj/project.pbxproj index faa62309e..cd90313ab 100644 --- a/InternalTestApp/InternalTestApp.xcodeproj/project.pbxproj +++ b/InternalTestApp/InternalTestApp.xcodeproj/project.pbxproj @@ -33,6 +33,8 @@ 530E722C292FACB20025B44D /* UIImageView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 530E722B292FACB20025B44D /* UIImageView+Extensions.swift */; }; 535ADDFB2D19731000DB888F /* PrebidUniversalCreativeTestingGAMController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 535ADDFA2D19731000DB888F /* PrebidUniversalCreativeTestingGAMController.swift */; }; 535ADDFC2D19731000DB888F /* PrebidUniversalCreativeTestingGAMController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 535ADDFA2D19731000DB888F /* PrebidUniversalCreativeTestingGAMController.swift */; }; + 535ADDFE2D19A62C00DB888F /* PrebidUniversalCreativeTestingWebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 535ADDFD2D19A62C00DB888F /* PrebidUniversalCreativeTestingWebViewController.swift */; }; + 535ADDFF2D19A62C00DB888F /* PrebidUniversalCreativeTestingWebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 535ADDFD2D19A62C00DB888F /* PrebidUniversalCreativeTestingWebViewController.swift */; }; 5397BD142936185400ABDA22 /* PrebidOriginalAPIDisplayBannerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5397BD132936185400ABDA22 /* PrebidOriginalAPIDisplayBannerController.swift */; }; 5397BD26293760F500ABDA22 /* PrebidOriginalAPIDisplayInterstitialController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5397BD25293760F500ABDA22 /* PrebidOriginalAPIDisplayInterstitialController.swift */; }; 5397BD2A29376C9700ABDA22 /* PrebidOriginalAPIVideoRewardedController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5397BD2929376C9700ABDA22 /* PrebidOriginalAPIVideoRewardedController.swift */; }; @@ -384,6 +386,7 @@ 3CC4A3E82C11F96800B97128 /* CustomRendererBannerController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomRendererBannerController.swift; sourceTree = ""; }; 530E722B292FACB20025B44D /* UIImageView+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImageView+Extensions.swift"; sourceTree = ""; }; 535ADDFA2D19731000DB888F /* PrebidUniversalCreativeTestingGAMController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrebidUniversalCreativeTestingGAMController.swift; sourceTree = ""; }; + 535ADDFD2D19A62C00DB888F /* PrebidUniversalCreativeTestingWebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrebidUniversalCreativeTestingWebViewController.swift; sourceTree = ""; }; 5397BD132936185400ABDA22 /* PrebidOriginalAPIDisplayBannerController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrebidOriginalAPIDisplayBannerController.swift; sourceTree = ""; }; 5397BD25293760F500ABDA22 /* PrebidOriginalAPIDisplayInterstitialController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrebidOriginalAPIDisplayInterstitialController.swift; sourceTree = ""; }; 5397BD2929376C9700ABDA22 /* PrebidOriginalAPIVideoRewardedController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrebidOriginalAPIVideoRewardedController.swift; sourceTree = ""; }; @@ -726,6 +729,7 @@ 539F961329DEF2670061E7A5 /* PrebidOriginalAPIVideoInterstitialController.swift */, 5397BD2929376C9700ABDA22 /* PrebidOriginalAPIVideoRewardedController.swift */, 535ADDFA2D19731000DB888F /* PrebidUniversalCreativeTestingGAMController.swift */, + 535ADDFD2D19A62C00DB888F /* PrebidUniversalCreativeTestingWebViewController.swift */, ); path = OriginalAPI; sourceTree = ""; @@ -1591,6 +1595,7 @@ 53ED2FF629798104007D13EE /* BaseConfigurationController.swift in Sources */, 53ED2FF729798104007D13EE /* NativeAsset+Extensions.swift in Sources */, 53ED2FF829798104007D13EE /* PrebidGAMNativeAdController.swift in Sources */, + 535ADDFE2D19A62C00DB888F /* PrebidUniversalCreativeTestingWebViewController.swift in Sources */, 53ED2FF929798104007D13EE /* PrebidOriginalAPIVideoInstreamViewController.swift in Sources */, 53ED2FFA29798104007D13EE /* PrebidAdMobBannerViewController.swift in Sources */, 53ED2FFB29798104007D13EE /* ConfigurableViewController.swift in Sources */, @@ -1688,6 +1693,7 @@ 5B209B4A21075E0A00C0F5CE /* BaseConfigurationController.swift in Sources */, 92C4E60B27A2F5D900738370 /* NativeAsset+Extensions.swift in Sources */, 92102C6127B0F2FE003F12B2 /* PrebidGAMNativeAdController.swift in Sources */, + 535ADDFF2D19A62C00DB888F /* PrebidUniversalCreativeTestingWebViewController.swift in Sources */, 5397BD322937895700ABDA22 /* PrebidOriginalAPIVideoInstreamViewController.swift in Sources */, 92E92502276B299F002B57F3 /* PrebidAdMobBannerViewController.swift in Sources */, 5BCCA3D62136D2E800DA3B5A /* ConfigurableViewController.swift in Sources */, diff --git a/InternalTestApp/PrebidMobileDemoRendering/Model/TestCasesManager.swift b/InternalTestApp/PrebidMobileDemoRendering/Model/TestCasesManager.swift index a78f08315..ab72c496a 100644 --- a/InternalTestApp/PrebidMobileDemoRendering/Model/TestCasesManager.swift +++ b/InternalTestApp/PrebidMobileDemoRendering/Model/TestCasesManager.swift @@ -486,6 +486,11 @@ struct TestCaseManager { setupCustomParams(for: bannerController.prebidConfigId) }), + TestCase(title: "Prebid Universal Creative (WebView)", + tags: [.banner, .originalAPI, .server], + exampleVCStoryboardID: "PrebidUniversalCreativeTestingWebViewController", + configurationClosure: { vc in }), + // MARK: ---- Native (Original API) TestCase(title: "Native Banner (GAM Original) [OK, PUC]", diff --git a/InternalTestApp/PrebidMobileDemoRendering/Resources/Base.lproj/Main.storyboard b/InternalTestApp/PrebidMobileDemoRendering/Resources/Base.lproj/Main.storyboard index 571f4d114..94081ba36 100644 --- a/InternalTestApp/PrebidMobileDemoRendering/Resources/Base.lproj/Main.storyboard +++ b/InternalTestApp/PrebidMobileDemoRendering/Resources/Base.lproj/Main.storyboard @@ -1,9 +1,9 @@ - + - + @@ -376,6 +376,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/InternalTestApp/PrebidMobileDemoRendering/ViewControllers/Adapters/Prebid/OriginalAPI/PrebidUniversalCreativeTestingWebViewController.swift b/InternalTestApp/PrebidMobileDemoRendering/ViewControllers/Adapters/Prebid/OriginalAPI/PrebidUniversalCreativeTestingWebViewController.swift new file mode 100644 index 000000000..417bdf9ea --- /dev/null +++ b/InternalTestApp/PrebidMobileDemoRendering/ViewControllers/Adapters/Prebid/OriginalAPI/PrebidUniversalCreativeTestingWebViewController.swift @@ -0,0 +1,32 @@ +/*   Copyright 2018-2024 Prebid.org, Inc. + +  Licensed under the Apache License, Version 2.0 (the "License"); +  you may not use this file except in compliance with the License. +  You may obtain a copy of the License at + +  http://www.apache.org/licenses/LICENSE-2.0 + +  Unless required by applicable law or agreed to in writing, software +  distributed under the License is distributed on an "AS IS" BASIS, +  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +  See the License for the specific language governing permissions and +  limitations under the License. +  */ + +import UIKit +import WebKit + +final class PrebidUniversalCreativeTestingWebViewController: UIViewController { + + @IBOutlet weak var webView: WKWebView! + @IBOutlet weak var textField: UITextField! + + @IBAction func onOpenURLPressed(_ sender: Any) { + guard let urlString = textField.text, let url = URL(string: "http://\(urlString)") else { + return + } + + let request = URLRequest(url: url) + webView.load(request) + } +} From 271ae995f7fdf509d6cd0e02c592e4c4254b71d1 Mon Sep 17 00:00:00 2001 From: Olena Stepaniuk Date: Tue, 24 Dec 2024 12:07:34 +0200 Subject: [PATCH 3/3] feat: clean up --- ...niversalCreativeTestingGAMController.swift | 44 +------------------ 1 file changed, 1 insertion(+), 43 deletions(-) diff --git a/InternalTestApp/PrebidMobileDemoRendering/ViewControllers/Adapters/Prebid/OriginalAPI/PrebidUniversalCreativeTestingGAMController.swift b/InternalTestApp/PrebidMobileDemoRendering/ViewControllers/Adapters/Prebid/OriginalAPI/PrebidUniversalCreativeTestingGAMController.swift index 76dd53721..678ddcb7f 100644 --- a/InternalTestApp/PrebidMobileDemoRendering/ViewControllers/Adapters/Prebid/OriginalAPI/PrebidUniversalCreativeTestingGAMController.swift +++ b/InternalTestApp/PrebidMobileDemoRendering/ViewControllers/Adapters/Prebid/OriginalAPI/PrebidUniversalCreativeTestingGAMController.swift @@ -80,49 +80,7 @@ final class PrebidUniversalCreativeTestingGAMController: rootController.bannerView.constraints.first { $0.firstAttribute == .width }?.constant = 300 rootController.bannerView.constraints.first { $0.firstAttribute == .height }?.constant = 500 - let targetWebView = bannerView.allSubViewsOf(type: WKWebView.self).first - - if #available(iOS 14.0, *) { - targetWebView?.configuration.defaultWebpagePreferences.allowsContentJavaScript = true - } else { - targetWebView?.configuration.preferences.javaScriptEnabled = true - } - - targetWebView?.navigationDelegate = self - -// let js = """ -// function loadNewIframe() { -// // The URL to load in the iframe -// const iframeUrl = "http://192.168.0.102:9876"; // You can change this dynamically -// -// // Create the iframe element -// const iframe = document.createElement("iframe"); -// iframe.src = iframeUrl; -// -// // Optional: Set other attributes like width, height, and frameBorder -// iframe.width = "100%"; -// iframe.height = "400px"; -// iframe.frameBorder = "0"; // Removes the border of the iframe -// -// // Append the iframe to the end of the body -// document.body.appendChild(iframe); -// } -// -// // Call the function to load the iframe (you can bind this to a button or another event) -// loadNewIframe(); -// """ -// -// targetWebView?.evaluateJavaScript(js) - +// let targetWebView = bannerView.allSubViewsOf(type: WKWebView.self).first // targetWebView?.load(URLRequest(url: URL(string: "http://192.168.0.102:9876")!)) } - - func bannerView(_ bannerView: GADBannerView, didFailToReceiveAdWithError error: any Error) { - print(error.localizedDescription) - } - - - - - }