Zentrust / OTPublishersHeadlessSDK

OTPublishersHeadlessSDK for iOS
Other
7 stars 5 forks source link

OT blocks ApplePay on web views #14

Open DamyanPOQ opened 2 years ago

DamyanPOQ commented 2 years ago

https://webkit.org/blog/9674/new-webkit-features-in-safari-13/

Screenshot 2022-08-12 at 12 57 06

suggested implementation to pass the consent is:

https://developer.onetrust.com/onetrust/docs/passing-consent-to-webview-ios-tvos

if let js = OTPublishersHeadlessSDK.shared.getOTConsentJSForWebView() { 

      // Pass JS from SDK method to a custom WebView script            
      let script = WKUserScript(source: js, injectionTime: .atDocumentStart, forMainFrameOnly: false)
             
      // Add the custom WebView script to WebView controller            
      config.userContentController.addUserScript(script)
}