iOS 12 and Apache Cordova : update from UIWebView to WKWebView

With the release of iOS12, Apple has changed several components of its operative system, between them you can find one the has a big impact on mobile app development because of the change in how iOS manages the webview.

Webview in Apache Cordova

In the iOS 12 the webview UIWebView, originally embedded in the iOS SDK, will deprecated. So developers have to migrate the webview to WKWebView component.

Starting form version 4, Cordova has implemented the webview in a special plugin,  cordova-plugin-wkwebview-engine , allowing flexibility for any mobile app. Furthermore from version 5, Cordova will embed both webview in the iOS platform bundle.

Limitations of WKWebView

Today there are a lot of limitations related to the use of WKWebView, well documented in a Michal Tsai article; we are going to mention the most important for us:

  • Cookies don’t persist;
  • Cookies cannot be eliminated;
  • You cannot execute javascript code in the background;
  • XmlHttpRequests don’t work;
  • Iframe are not supported.

Moreover there are several bugs you can read more.

How to migrate from UIWebView to WKWebView

It is possible to migrate from one webview to the other one but you have to use a lot of plugins and some workarounds.

Contact us for more information.

Leave a Reply