Skip to content

Commit

Permalink
feat: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
OlenaPostindustria committed Jan 6, 2025
1 parent 0ff1ad6 commit 9a19411
Showing 1 changed file with 1 addition and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}





}

0 comments on commit 9a19411

Please sign in to comment.