What's new in WKWebView

RSS for tag

Discuss the WWDC22 Session What's new in WKWebView

Posts under wwdc2022-10049 tag

43 Posts

Post

Replies

Boosts

Views

Activity

iOS 16.0+ H5 video has issues with blob-url
For iOS 16.0+ iPhone, when the src of video tag is blob URL which created by URL.create ObjectURL , iOS WebView decoding fails and the iPhone's screen recording function is affected. As a result, screen-recording videos cannot be properly stored and recorded, resulting in a screen recording failure. Reload page or create multi-video-element,failure rate is close to 100% export function createBlobURLForMp4Source(source: string): Promise<string> { const URL = (window as any).webkitURL || window.URL; return new Promise((resolve, reject) => { const xhr = new XMLHttpRequest(); xhr.open('GET', source, true); xhr.responseType = 'blob'; xhr.onload = function (): void { if (xhr.status === 200 || xhr.status === 304) { const res = xhr.response; if (/iphone|ipad|ipod/i.test(navigator.userAgent)) { const fileReader = new FileReader(); fileReader.onloadend = function (): void { const resultStr = fileReader.result as string; const raw = atob(resultStr.slice(resultStr.indexOf(',') + 1)); const buf = Array(raw.length); for (let d = 0; d < raw.length; d++) { buf[d] = raw.charCodeAt(d); } const arr = new Uint8Array(buf); const blob = new Blob([arr], { type: 'video/mp4' }); resolve(URL.createObjectURL(blob)); }; fileReader.readAsDataURL(xhr.response); } else { resolve(URL.createObjectURL(res)); } } else { reject(new Error(`http response invalid${xhr.status}`)); } }; xhr.send(); }); }
0
0
1.2k
Dec ’22
WKWebview not showing pdf file in iOS devices.
Hi, i'm using Swift Language to develop iOS apps. my Query is: From the Web services API, i have download the pdf file into Document Directory (external path) in iPhone/iPad. Downloaded PDF file NOT showing on WKWebviewer in iPhone/iPad devices due to blocking(apple permission issue) the Document Directory (external path). it is showing empty gray colour. but Above behaviour is working fine in the iOS Simulator that pdf file is launching fine on WKWEbviewer and showing all the pages from the pdf file. How to give the read permission to Document Directory (external path) to launch the pdf file on WKWebview in iOS Devices ?
0
0
882
Nov ’22
webview not working on iPhone after iOS 16.1.1 update
I am using webview_flutter 3.0.4 to load a login web page in iOS I have tried both on simulator and on device the app loading it shows the webpage login page for a few milisecounds and then crashs and I get this error WKErrorDomain WebResourceErrorType.webContentProcessTerminated WebView_flutter uses WKWebview. The app works fine one any iOS version below 16.1.1 but on 16.1.1 the WebView crashes at the start of the app. I am using Webpage url that use OAuth 2.0 to generate a unique login challenge everytime.
1
0
4.5k
Nov ’22
Can't import Firebase Cloud Messaging Device Token from AppDelegate to Content View
Friends, I just joined you. I have developed a wkwebview application and have firebase integration, but I need to send the device token of each device as a parameter along with the load url of the wkwebview, but I cannot pass the token from appdelegate to the content view. I am getting nil value or error. Is there any way we can load it into wkwebview via appdelegate? I can create a url with the parameter given in Apple Delegate, but I cannot transfer this url to wkwebview or content view. example: extension AppDelegate: MessagingDelegate {     func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) {      // let deviceToken:[String: String] = ["token": fcmToken ?? ""]         url = "http://localhost:5185/ogrAuth/signIn?token=\(fcmToken ?? "")";              }      }
0
0
661
Nov ’22
Using WKScriptMessageHandler to receive sensitive data
My MacOS application has a webview and I've been subclassing WKScriptMessageHandler to handle several messages received from the javascript code. For a new feature I would like to save user's password in the Keychain, to do so I need to send the password from the Javascript to the Swift codebase. The javascript code would be something like this: window.webkit.messageHandlers.loginData.postMessage({username: 'john', password: 'p@ss!123'}) Before implementing this approach I would like to know if there are any security vulnerabilities that I should know about. The sensitive data is being sent from the Javascript to the Swift code, so I wonder if it would be possible for someone to intercept it or getting the sensitive data somehow.
0
0
961
Oct ’22
WKWebView loadHTMLString is not loading embedded Video in some circumstances
On the iOS 15 os version loadHTMLString are not able to load the embedded Video in the HTML script. I can't see any error logs in the console.  let sourcepath = "https://www.youtube.com/watch?v=XSdGBXYe9og"     let htmlString = "<p><iframe style=\"border:1px solid #999999\" src=\(sourcepath) width=\"400\" height=\"320\" allowfullscreen=\"allowfullscreen\"></iframe></p>"     webView.loadHTMLString(htmlString, baseURL: nil) I am using the above code snippet to load the HHTML content. It is working for youtube videos but it is not loading from some private domain. The same video, I am able to play on the iPad with the same code. The video is loading if I am using webView.load() API of WKwebView library or directly in safari browser in iPhone. Do I miss something in loadHTMLString API? Please suggest the solution to fix the problem. Thank you!
0
0
884
Sep ’22
problem of application execution speed
We've created an webview style hybrid app, using framework based on PHP Compared to Android, it takes twice as much time to load the app on the iphone We've packaged the app using wk webview which based on Safari. Is there any issue that we can check in order to solve such slow running problem on iphone? Best regards, Son Seung Hee ICT Department, Apartners Co.
0
0
758
Sep ’22
How to get the URL of current wkwebview that was opened in a new tab?
I have a WkWebview that opens a child WkWebview in a new tab. I am trying to display the URL of the current webview to the user at the top in the navigation bar. I'm able to achieve this using the webView.URL property for the parent webview, but this same property returns a blank string when used for the child webview. I've also tried using the navigationAction.request.URL as an alternative for the child webview, but that also returns an empty string. The child webview opens flawlessly and I don't see any other issues in it other than the URL thing. How can I get the current URL of the child webview? Code for creating a child webview that opens in a new tab: - (nullable WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures { self.popupWebView = [[WKWebView alloc] initWithFrame:self.webView.frame configuration:configuration]; self.popupWebView.UIDelegate = self; self.popupWebView.navigationDelegate = self; [self.webView addSubview:self.popupWebView]; NSLog( @"Pop up webview navigationAction URL: '%@'", navigationAction.request.URL.absoluteString ); self.controller.navigationItem.title = navigationAction.request.URL.absoluteString; return self.popupWebView; } Interface to which "self" is referring to in the above code: `NS_ASSUME_NONNULL_BEGIN @interface WkWebViewModule : NSObject &lt;RCTBridgeModule, WKUIDelegate, WKNavigationDelegate&gt; @property (nonatomic) UIViewController *controller; @property (nonatomic) UINavigationController *navigationController; @property (nonatomic) WKWebView *webView; @property (nonatomic) UINavigationItem *navItem; @property (nonatomic) UINavigationBar *navbar; @property (nonatomic) WKWebView *popupWebView; @property (nonatomic) WKPreferences *wkPreferences; @end NS_ASSUME_NONNULL_END ` Thanks!
0
1
1.2k
Aug ’22
How do you resize the gif displayed in WKWebView
I want to display a gif that it fits in WKWebView. (like Aspect fit.) gif is stored locally. This is sample code and Autolayout.↓ import UIKit import WebKit class ViewController: UIViewController {   @IBOutlet weak var webView: WKWebView!       override func viewDidLoad() {     super.viewDidLoad()           guard let url = Bundle.main.url(forResource: "sample", withExtension: "gif"),        let data = try? Data(contentsOf: url),        let baseURL = Foundation.URL(string: "about:blank") else {       return     }     webView.load(data, mimeType: "image/gif", characterEncodingName: "UTF-8", baseURL: baseURL)         } } use the gif from this link.↓ https://sozai-good.com/illust/animal/5677 When run this code, the gif is cut off. (use iPhone13 pro) How do you resize the gif?
1
0
1.8k
Aug ’22
is it possible to deploy web-view application on App store?
I have been deploying application which shows usual web-view as a result of sending for review. Apple team keep telling to that my app has minimum functionality screen show below Guideline 4.2 - Design - Minimum Functionality Your app provides a limited user experience as it is not sufficiently different from a mobile browsing experience. As such, the experience it provides is similar to the general experience of using Safari. Including iOS features such as push notifications, Core Location, and sharing do not provide a robust enough experience to be appropriate for the App Store. Next Steps To resolve this issue, please revise your app to provide a more robust user experience by including additional native iOS functionality. If you cannot - or choose not to - revise your app to be in compliance with the App Store Review Guidelines, you may wish to build an HTML5 web app instead. You can distribute web apps directly on your web site; the App Store does not accept or distribute web apps. For more information about creating web apps, refer to the Configuring Web Applications section of the Safari Web Content Guide. For a description of the HTML elements and attributes you can use in Safari on iPhone, check out Safari HTML Reference: Introduction.
0
0
3.5k
Aug ’22
Remote web inspector requirements for browsers on iOS 16
Hello Guys, Our application has default web browser entitlement: com.apple.developer.web-browser. However, I am not seeing it in Desktop Safari's Developer menu, I am using iPadOS 16 beta 2(20A5303i), Web Inspector is enabled in Safari's Advanced menu. Do we need to do some additional updates like rebuilding app with Xcode 14 or build that we currently have in AppStore should work without any modifications?
2
0
1.6k
Jul ’22
WKWebview insdie UITableviewcell with dynamic height
Hello, I have used WKWebview inside my tableview cell and given constraint inside my xib file. I am loading html text in webview which i get from server side in api and i have taken webview height constraint property for update height on did finish delegate method. It's not working proper and not giving proper height and on scroll every-time it's rendering with different height. My requirement is i want to display math equations and html content on webview with dynamic height of cell. I have done research and tried everything but it's not working. I am using below code for update webview height. func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {     webView.evaluateJavaScript("document.readyState", completionHandler: { (ready, error) in       if ready != nil {         DispatchQueue.main.asyncAfter(deadline: .now()) {           webView.evaluateJavaScript("document.body.scrollHeight") { [weak self] (result, _) in             guard let self = self, let result = result as? Double else { return }             self.webViewHeightConstraint.constant = CGFloat(result)             self.webView.updateConstraints()            }         }       }     })   }     Please help me to solve this issue. Thank you
0
0
1.6k
Jul ’22
WKWebView to go unresponsive and crash in iOS 15
We're having problems in iOS 15.0+ with WKWebView and this assertion: [assertion] Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}> [ProcessSuspension] 0x116004e40 - ProcessAssertion: Failed to acquire RBS assertion 'ConnectionTerminationWatchdog' for process with PID=11505, error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit} No problems for iOS versions < 15, and disabling this feature fixed the issue for us. We are looking to understand if this feature is intended to be enabled as part of iOS 15's official release. Curious if there is any insight available.
0
1
1.4k
Jul ’22
WKWebView exhibits strange behaviour when it is running a web site having service worker and indexDB database
Hello, We are running a complex web application built with React and related ecosystem. this web application is essentially a PWA and it is offline first. So, It relies heavily on service worker, indexDB database, cache storage, local storage etc. We are running this web application inside a WKWebView which resides in a native iOS App. We have noticed that WKWebView is highly unreliable when it is running such a complex web app. some of the behaviours noticed are only blank screen is shown with no content loaded from the url when url is pointed to different location (say uat, qa, prod environments) in the same wkwebview at run time, it causes data corruption as part of indexdb. it seems that it is not keeping different sets of data for different urls. when registering newer version of service workers, wkwebview errors out and can not proceed with new registrations does not always show a target page when a react app programmatically navigates to different locations within the web app. I am interested in knowing from fellow iOS developers that have you previously experienced above with WKWebView? is WKWebView a good option for running such a web application or SFSafariView is the better alternative? thank you Dilip
1
0
987
Jul ’22
iOS 16.0+ H5 video has issues with blob-url
For iOS 16.0+ iPhone, when the src of video tag is blob URL which created by URL.create ObjectURL , iOS WebView decoding fails and the iPhone's screen recording function is affected. As a result, screen-recording videos cannot be properly stored and recorded, resulting in a screen recording failure. Reload page or create multi-video-element,failure rate is close to 100% export function createBlobURLForMp4Source(source: string): Promise<string> { const URL = (window as any).webkitURL || window.URL; return new Promise((resolve, reject) => { const xhr = new XMLHttpRequest(); xhr.open('GET', source, true); xhr.responseType = 'blob'; xhr.onload = function (): void { if (xhr.status === 200 || xhr.status === 304) { const res = xhr.response; if (/iphone|ipad|ipod/i.test(navigator.userAgent)) { const fileReader = new FileReader(); fileReader.onloadend = function (): void { const resultStr = fileReader.result as string; const raw = atob(resultStr.slice(resultStr.indexOf(',') + 1)); const buf = Array(raw.length); for (let d = 0; d < raw.length; d++) { buf[d] = raw.charCodeAt(d); } const arr = new Uint8Array(buf); const blob = new Blob([arr], { type: 'video/mp4' }); resolve(URL.createObjectURL(blob)); }; fileReader.readAsDataURL(xhr.response); } else { resolve(URL.createObjectURL(res)); } } else { reject(new Error(`http response invalid${xhr.status}`)); } }; xhr.send(); }); }
Replies
0
Boosts
0
Views
1.2k
Activity
Dec ’22
WKWebview not showing pdf file in iOS devices.
Hi, i'm using Swift Language to develop iOS apps. my Query is: From the Web services API, i have download the pdf file into Document Directory (external path) in iPhone/iPad. Downloaded PDF file NOT showing on WKWebviewer in iPhone/iPad devices due to blocking(apple permission issue) the Document Directory (external path). it is showing empty gray colour. but Above behaviour is working fine in the iOS Simulator that pdf file is launching fine on WKWEbviewer and showing all the pages from the pdf file. How to give the read permission to Document Directory (external path) to launch the pdf file on WKWebview in iOS Devices ?
Replies
0
Boosts
0
Views
882
Activity
Nov ’22
webview not working on iPhone after iOS 16.1.1 update
I am using webview_flutter 3.0.4 to load a login web page in iOS I have tried both on simulator and on device the app loading it shows the webpage login page for a few milisecounds and then crashs and I get this error WKErrorDomain WebResourceErrorType.webContentProcessTerminated WebView_flutter uses WKWebview. The app works fine one any iOS version below 16.1.1 but on 16.1.1 the WebView crashes at the start of the app. I am using Webpage url that use OAuth 2.0 to generate a unique login challenge everytime.
Replies
1
Boosts
0
Views
4.5k
Activity
Nov ’22
Can't import Firebase Cloud Messaging Device Token from AppDelegate to Content View
Friends, I just joined you. I have developed a wkwebview application and have firebase integration, but I need to send the device token of each device as a parameter along with the load url of the wkwebview, but I cannot pass the token from appdelegate to the content view. I am getting nil value or error. Is there any way we can load it into wkwebview via appdelegate? I can create a url with the parameter given in Apple Delegate, but I cannot transfer this url to wkwebview or content view. example: extension AppDelegate: MessagingDelegate {     func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) {      // let deviceToken:[String: String] = ["token": fcmToken ?? ""]         url = "http://localhost:5185/ogrAuth/signIn?token=\(fcmToken ?? "")";              }      }
Replies
0
Boosts
0
Views
661
Activity
Nov ’22
The web worker cannot call all CPU resources in the wkwebview
I use the wkwebview to load web resources. The web worker used in the web page speeds up the calculation process. However, no matter how many web workers are enabled in the actual use process, the calculation speed is the same. It seems that wkwebviw does not call all the CPUs to speed up the calculation.
Replies
0
Boosts
1
Views
1.2k
Activity
Nov ’22
An issue where content using wkwebview appears small intermittently
Please give me some advice
Replies
5
Boosts
0
Views
774
Activity
Nov ’22
Clickable links in webview
Trying to get my external links to be clickable. Please help!! Here is my code.
Replies
1
Boosts
0
Views
642
Activity
Oct ’22
Using WKScriptMessageHandler to receive sensitive data
My MacOS application has a webview and I've been subclassing WKScriptMessageHandler to handle several messages received from the javascript code. For a new feature I would like to save user's password in the Keychain, to do so I need to send the password from the Javascript to the Swift codebase. The javascript code would be something like this: window.webkit.messageHandlers.loginData.postMessage({username: 'john', password: 'p@ss!123'}) Before implementing this approach I would like to know if there are any security vulnerabilities that I should know about. The sensitive data is being sent from the Javascript to the Swift code, so I wonder if it would be possible for someone to intercept it or getting the sensitive data somehow.
Replies
0
Boosts
0
Views
961
Activity
Oct ’22
WKWebView loadHTMLString is not loading embedded Video in some circumstances
On the iOS 15 os version loadHTMLString are not able to load the embedded Video in the HTML script. I can't see any error logs in the console.  let sourcepath = "https://www.youtube.com/watch?v=XSdGBXYe9og"     let htmlString = "<p><iframe style=\"border:1px solid #999999\" src=\(sourcepath) width=\"400\" height=\"320\" allowfullscreen=\"allowfullscreen\"></iframe></p>"     webView.loadHTMLString(htmlString, baseURL: nil) I am using the above code snippet to load the HHTML content. It is working for youtube videos but it is not loading from some private domain. The same video, I am able to play on the iPad with the same code. The video is loading if I am using webView.load() API of WKwebView library or directly in safari browser in iPhone. Do I miss something in loadHTMLString API? Please suggest the solution to fix the problem. Thank you!
Replies
0
Boosts
0
Views
884
Activity
Sep ’22
UIMenuController is deprecated. Use UIEditMenuInteraction instead. iOS 16
I am using UIMenuControllerWillShowMenuNotification in my app. but in iOS16 UIMenuController is deprecated. I want to check when menu is open but in UIEditMenuInteraction class no Notification is available. In webview I need to show custom menu not default menu.
Replies
0
Boosts
2
Views
1.4k
Activity
Sep ’22
problem of application execution speed
We've created an webview style hybrid app, using framework based on PHP Compared to Android, it takes twice as much time to load the app on the iphone We've packaged the app using wk webview which based on Safari. Is there any issue that we can check in order to solve such slow running problem on iphone? Best regards, Son Seung Hee ICT Department, Apartners Co.
Replies
0
Boosts
0
Views
758
Activity
Sep ’22
Webview on APPS
Hello, I have a small question before starting the development of my iOS application. I wanted to know if webview apps are allowed on the app store? What if we can add a payment solution for a subscription? Thank you in advance for your replies Olivier
Replies
0
Boosts
0
Views
624
Activity
Aug ’22
How to get the URL of current wkwebview that was opened in a new tab?
I have a WkWebview that opens a child WkWebview in a new tab. I am trying to display the URL of the current webview to the user at the top in the navigation bar. I'm able to achieve this using the webView.URL property for the parent webview, but this same property returns a blank string when used for the child webview. I've also tried using the navigationAction.request.URL as an alternative for the child webview, but that also returns an empty string. The child webview opens flawlessly and I don't see any other issues in it other than the URL thing. How can I get the current URL of the child webview? Code for creating a child webview that opens in a new tab: - (nullable WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures { self.popupWebView = [[WKWebView alloc] initWithFrame:self.webView.frame configuration:configuration]; self.popupWebView.UIDelegate = self; self.popupWebView.navigationDelegate = self; [self.webView addSubview:self.popupWebView]; NSLog( @"Pop up webview navigationAction URL: '%@'", navigationAction.request.URL.absoluteString ); self.controller.navigationItem.title = navigationAction.request.URL.absoluteString; return self.popupWebView; } Interface to which "self" is referring to in the above code: `NS_ASSUME_NONNULL_BEGIN @interface WkWebViewModule : NSObject &lt;RCTBridgeModule, WKUIDelegate, WKNavigationDelegate&gt; @property (nonatomic) UIViewController *controller; @property (nonatomic) UINavigationController *navigationController; @property (nonatomic) WKWebView *webView; @property (nonatomic) UINavigationItem *navItem; @property (nonatomic) UINavigationBar *navbar; @property (nonatomic) WKWebView *popupWebView; @property (nonatomic) WKPreferences *wkPreferences; @end NS_ASSUME_NONNULL_END ` Thanks!
Replies
0
Boosts
1
Views
1.2k
Activity
Aug ’22
How do you resize the gif displayed in WKWebView
I want to display a gif that it fits in WKWebView. (like Aspect fit.) gif is stored locally. This is sample code and Autolayout.↓ import UIKit import WebKit class ViewController: UIViewController {   @IBOutlet weak var webView: WKWebView!       override func viewDidLoad() {     super.viewDidLoad()           guard let url = Bundle.main.url(forResource: "sample", withExtension: "gif"),        let data = try? Data(contentsOf: url),        let baseURL = Foundation.URL(string: "about:blank") else {       return     }     webView.load(data, mimeType: "image/gif", characterEncodingName: "UTF-8", baseURL: baseURL)         } } use the gif from this link.↓ https://sozai-good.com/illust/animal/5677 When run this code, the gif is cut off. (use iPhone13 pro) How do you resize the gif?
Replies
1
Boosts
0
Views
1.8k
Activity
Aug ’22
is it possible to deploy web-view application on App store?
I have been deploying application which shows usual web-view as a result of sending for review. Apple team keep telling to that my app has minimum functionality screen show below Guideline 4.2 - Design - Minimum Functionality Your app provides a limited user experience as it is not sufficiently different from a mobile browsing experience. As such, the experience it provides is similar to the general experience of using Safari. Including iOS features such as push notifications, Core Location, and sharing do not provide a robust enough experience to be appropriate for the App Store. Next Steps To resolve this issue, please revise your app to provide a more robust user experience by including additional native iOS functionality. If you cannot - or choose not to - revise your app to be in compliance with the App Store Review Guidelines, you may wish to build an HTML5 web app instead. You can distribute web apps directly on your web site; the App Store does not accept or distribute web apps. For more information about creating web apps, refer to the Configuring Web Applications section of the Safari Web Content Guide. For a description of the HTML elements and attributes you can use in Safari on iPhone, check out Safari HTML Reference: Introduction.
Replies
0
Boosts
0
Views
3.5k
Activity
Aug ’22
Can I customize a color of cursor and text selection?
I'm working on an app where people can share their message like other messenger. For some accessibility issue(color contrast ratio), I want to change the color of cursor and text selection which are normally blue. Is there any way I can customize the color of those? I would appreciate it if you can share any help. Thank you.
Replies
0
Boosts
1
Views
730
Activity
Jul ’22
Remote web inspector requirements for browsers on iOS 16
Hello Guys, Our application has default web browser entitlement: com.apple.developer.web-browser. However, I am not seeing it in Desktop Safari's Developer menu, I am using iPadOS 16 beta 2(20A5303i), Web Inspector is enabled in Safari's Advanced menu. Do we need to do some additional updates like rebuilding app with Xcode 14 or build that we currently have in AppStore should work without any modifications?
Replies
2
Boosts
0
Views
1.6k
Activity
Jul ’22
WKWebview insdie UITableviewcell with dynamic height
Hello, I have used WKWebview inside my tableview cell and given constraint inside my xib file. I am loading html text in webview which i get from server side in api and i have taken webview height constraint property for update height on did finish delegate method. It's not working proper and not giving proper height and on scroll every-time it's rendering with different height. My requirement is i want to display math equations and html content on webview with dynamic height of cell. I have done research and tried everything but it's not working. I am using below code for update webview height. func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {     webView.evaluateJavaScript("document.readyState", completionHandler: { (ready, error) in       if ready != nil {         DispatchQueue.main.asyncAfter(deadline: .now()) {           webView.evaluateJavaScript("document.body.scrollHeight") { [weak self] (result, _) in             guard let self = self, let result = result as? Double else { return }             self.webViewHeightConstraint.constant = CGFloat(result)             self.webView.updateConstraints()            }         }       }     })   }     Please help me to solve this issue. Thank you
Replies
0
Boosts
0
Views
1.6k
Activity
Jul ’22
WKWebView to go unresponsive and crash in iOS 15
We're having problems in iOS 15.0+ with WKWebView and this assertion: [assertion] Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}> [ProcessSuspension] 0x116004e40 - ProcessAssertion: Failed to acquire RBS assertion 'ConnectionTerminationWatchdog' for process with PID=11505, error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit} No problems for iOS versions < 15, and disabling this feature fixed the issue for us. We are looking to understand if this feature is intended to be enabled as part of iOS 15's official release. Curious if there is any insight available.
Replies
0
Boosts
1
Views
1.4k
Activity
Jul ’22
WKWebView exhibits strange behaviour when it is running a web site having service worker and indexDB database
Hello, We are running a complex web application built with React and related ecosystem. this web application is essentially a PWA and it is offline first. So, It relies heavily on service worker, indexDB database, cache storage, local storage etc. We are running this web application inside a WKWebView which resides in a native iOS App. We have noticed that WKWebView is highly unreliable when it is running such a complex web app. some of the behaviours noticed are only blank screen is shown with no content loaded from the url when url is pointed to different location (say uat, qa, prod environments) in the same wkwebview at run time, it causes data corruption as part of indexdb. it seems that it is not keeping different sets of data for different urls. when registering newer version of service workers, wkwebview errors out and can not proceed with new registrations does not always show a target page when a react app programmatically navigates to different locations within the web app. I am interested in knowing from fellow iOS developers that have you previously experienced above with WKWebView? is WKWebView a good option for running such a web application or SFSafariView is the better alternative? thank you Dilip
Replies
1
Boosts
0
Views
987
Activity
Jul ’22