Latest 1.1.0
Homepage https://github.com/apache/cordova-plugin-wkwebview-engine
License Apache License, Version 2.0 “type”: “Apache License, Version 2.0”,
“text”: ” Licensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Platforms ios 9.0, requires ARC
Dependencies Cordova
Authors

Build Status

Cordova WKWebView Engine

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. However, you are still not able to use XHR from the file:// protocol without CORS enabled on your server.

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 [email protected]
cordova plugin add cordova-plugin-wkwebview-engine

To test the development version:

cordova create wkwvtest my.project.id wkwvtest
cd wkwvtest
cordova platform add https://github.com/apache/cordova-ios.git#master
cordova plugin add https://github.com/apache/cordova-plugin-wkwebview-engine.git#master

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 the limitations of using WKWebView as outlined in our 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

Latest podspec

{
    "name": "cordova-plugin-wkwebview-engine",
    "version": "1.1.0",
    "summary": "Cordova WKWebView Engine Plugin",
    "description": "This plugin allows Cordova to use the WKWebView component instead of the default UIWebView component, and is installable only on a system with the iOS 9.0 SDK.",
    "homepage": "https://github.com/apache/cordova-plugin-wkwebview-engine",
    "license": {
        "type": "Apache License, Version 2.0",
        "text": "    "type": "Apache License, Version 2.0",n    "text": "      Licensed under the Apache License, Version 2.0 (the "License");n      you may not use this file except in compliance with the License.n      You may obtain a copy of the License atn      n      http://www.apache.org/licenses/LICENSE-2.0n      n      Unless required by applicable law or agreed to in writing, softwaren      distributed under the License is distributed on an "AS IS" BASIS,n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.n      See the License for the specific language governing permissions andn      limitations under the License.n"n"
    },
    "authors": {
        "The Adobe PhoneGap Team": ""
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/apache/cordova-plugin-wkwebview-engine.git",
        "tag": "1.1.0"
    },
    "source_files": "src/ios/*.{h,m}",
    "preserve_paths": [
        "*.md",
        "docs/**/*.md",
        "www/*.js",
        "www/ios/*.js"
    ],
    "requires_arc": true,
    "dependencies": {
        "Cordova": [
            ">= 4.3.0"
        ]
    }
}

Pin It on Pinterest

Share This