@mendix/cordova-plugin-wkwebview-engine

1.0.3-mx.1.4.0 • Public • Published

Cordova WKWebView Engine Mx

This plugin makes Cordova use the WKWebView component instead of the default UIWebView component, and is installable only on a system with the iOS 9.0 SDK.

In iOS 9, Apple has fixed the issue present through iOS 8 where you cannot load locale files using file://, and must resort to using a local webserver. As all the XMLHttpRequests are no longer handled by WKWebView but are processed in native code you don't need to enable CORS on you server. When you need to download files to the device and want WKWebView to be able to get them by a request (e.g, for images and scripts) you can do that by downloading them to cordova.wkwebview.storageDir.

Installation

This plugin needs cordova-ios >4.0.0.

To install the current release:

cordova create wkwvtest my.project.id wkwvtest
cd wkwvtest
cordova platform add ios@4
cordova plugin add @mendix/cordova-plugin-wkwebview-engine-mx

You also must have Xcode 7 (iOS 9 SDK) installed. Check your Xcode version by running:

xcode-select --print-path

Required Permissions

WKWebView may not fully launch (the deviceready event may not fire) unless if the following is included in config.xml:

config.xml

    <feature name="CDVWKWebViewEngine">
        <param name="ios-package" value="CDVWKWebViewEngine" />
    </feature>

    <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />

Notes

On an iOS 8 system, Apache Cordova during runtime will switch to using the UIWebView engine instead of using this plugin. If you want to use WKWebView on both iOS 8 and iOS 9 platforms, you will have to resort to using a local webserver.

We have an experimental plugin that does this. You would use that plugin instead of this one.

Application Transport Security (ATS) in iOS 9

The next released version of the cordova-cli 5.4.0 will support automatic conversion of the <access> tags in config.xml to Application Transport Security ATS directives. Upgrade to the version 5.4.0 to use this new functionality.

Limitations

If you are upgrading from UIWebView, please note there are a number of limitations of using WKWebView. These can be find at apache cordova issue tracker.

Apple Issues

The AllowInlineMediaPlayback preference will not work because of this Apple bug. This bug has been fixed in iOS 10.

Supported Platforms

  • iOS

Readme

Keywords

Package Sidebar

Install

npm i @mendix/cordova-plugin-wkwebview-engine

Weekly Downloads

0

Version

1.0.3-mx.1.4.0

License

Apache-2.0

Unpacked Size

111 kB

Total Files

28

Last publish

Collaborators

  • vadymvmndx
  • selimustel.mendix
  • mendix-moo
  • content-teams
  • latrofa.mendix
  • tizar.mendix
  • modelingservices
  • kevinvl
  • yhn
  • bvanreeven
  • guidojo
  • erik.van.de.pol
  • rickymx
  • mx-juan
  • juliana-mx
  • meisam.mahdian
  • mx-stevenlynagh
  • sander-vdv
  • kmameletzi
  • jules.van.thillo
  • mx-jaro
  • ionut.holbea