How can I retrieve a file using WKWebView?

Right now, WKWebView instances will ignore any of the default networking storages (NSURLCache, NSHTTPCookieStorage, NSCredentialStorage) and also the standard networking classes you can use to customize the network requests (NSURLProtocol, etc.). So the cookies of the WKWebView instance are not stored in the standard Cookie storage of your App, and so NSURLSession/NSURLConnection which only uses … Read more

How does one Print all WKWebView On AND Offscreen content OSX and iOS

I’ve successfully used the SPI -[WKWebView _printOperationWithPrintInfo:] passing the usual [NSPrintInfo sharedPrintInfo]. Note that you CAN’T use -runOperation on the returned NSPrintOperation. You must use -runOperationModalForWindow:…. which is quite similar. The problem resides in the WebKit internals that expects a running runloop and a preview to be made internally to know the number of pages. … Read more

ITMS-90809: Deprecated API Usage – existing app that use UIWebView are no longer accepted

Yes, Apple did change the policies Are you using ionic? if so, install these: cordova plugin add cordova-plugin-ionic-webview@latest npm install @ionic-native/ionic-webview Then add this to your config.xml under ios platform: <preference name=”WKWebViewOnly” value=”true” /> <feature name=”CDVWKWebViewEngine”>` <param name=”ios-package” value=”CDVWKWebViewEngine” /> </feature> <preference name=”CordovaWebViewEngine” value=”CDVWKWebViewEngine” /> Finally run ionic cordova prepare ios to reflect the changes … Read more

Swift 3 – Check if WKWebView has loaded page

Answer (Big thanks to @paulvs ) To check if your WKWebView has loaded easily implement the following method: import WebKit import UIKit class ViewController: UIViewController, WKNavigationDelegate { let webView = WKWebView() func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { print(“loaded”) } override func viewDidLoad() { super.viewDidLoad() let url = URL(string: “https://www.yourwebsite.com/”) ! let request = … Read more

Cookie sharing between multiple WKWebViews

Got this working by using the same WKProcessPool for all the webviews. First create a process pool once somewhere: processPool = [[WKProcessPool alloc] init]; Then use it when creating WKWebviews. The pool must be set in the init method, not afterwards. WKWebViewConfiguration *config = [[WKWebViewConfiguration alloc] init]; config.processPool = processPool; webview = [[WKWebView alloc] initWithFrame:frame … Read more