Cordova iOS 9上的WKWebView状态? [英] State of WKWebView on Cordova iOS 9?

查看:244
本文介绍了Cordova iOS 9上的WKWebView状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iOS 8推出了WKWebView,一个具有更多功能的iOS的现代化网络视图,尤其是显着提高性能的JavaScript代码的JIT编译。



但是iOS 8上的WKWebView有一些错误,阻止Cordova默认使用它。 AFAIK有插件可以使用它,但他们都说测试版,不完整等也。据我所知,iOS 9修复了停止Cordova默认WKWebView在iOS 8中的错误。



那么在iOS 9上的Cordova中WKWebView的状态是什么?我似乎找不到任何有关这方面的信息。 Cordova在iOS 9上默认为WKWebView?

解决方案

新编辑: 2016年8月24日 strong>



更新只是为了添加离子框架团队创建的apache的 WKWebView 插件的一个分支对插件的增强。



https:// github。 com / driftyco / cordova-plugin-wkwebview-engine



这些增强功能很快就会登陆核心插件,但您可以查看并测试



新编辑: 2015年12月9日



cordova ios 4.0 .0 已发布
版本1.0.0 cordova- plugin-wkwebview-engine



尝试:

 code> cordova create wkwvtest my.project.id wkwvtest 
cd wkwvtest
cordova平台添加ios @ 4
cordova插件添加cordova-plugin-wkwebview-engine
<正如我已经说过,cordova-plugin-wkwebview-engine只支持iOS 9,在iOS 8上,它将使用UIWebView,并且有一些已知问题



如果您也想支持iOS 8,您可以使用 wkwebview-engine-localhost (实验性)或 cordova-plugin -wkwebview ,他们都使用本地网络服务器



https://github.com/apache/cordova-plugins/tree/master/wkwebview-engine-localhost



OLD MESSAGE:



您可以使用WKWebView with cordova使用可用的WKWebView插件。



你提到的问题是WKWebView无法加载本地文件,所以插件使用本地Web服务器解决这个问题。



有些人喜欢这个telerik https://github.com/Telerik-Verified-Plugins/WKWebView (内置网络服务器)或来自cordova小组的官员 https://github.com/apache/cordova-plugins/ tree / master / wkwebview-engine-localhost (将Web服务器作为依赖插件)



由于您提到的错误在iOS 9上是固定的, cordova插件(与iOS 8和iOS 9兼容,使用Web服务器)已重命名为wkwebview-engine-localhost,当前名称cordova-plugin-wkwebview-engine将用于支持iOS 9的新插件



您可以在这里查看问题以跟踪进度



https://issues.apache.org/jira/browse/CB-9566



https://issues.apache.org/jira/browse/CB-9567



编辑:我带来新闻 https://shazronatadobe.wordpress.com/2015/09/09/apache-cordova-ios-4-0-0-and-wkwebview-support/ a>


WKWebView支援



cordova-plugin-wkwebview-将只有iOS 9,它
将是一个核心插件。这个更新的插件的开发仍然是
。苹果已经修复了我们无法从file:// urls加载文档
的错误,它只有iOS 9。在非iOS 9设备上,
cordova-ios将回退到使用UIWebView。



旧版本的插件使用本地网络服务器加载您的
主文档。这个较旧的插件可以用于您想在iOS 8和iOS 9部署中使用
WKWebView,但插件将
保留为cordova实验室实验。这个插件有一些重新生成
的工作要完成。



iOS 8 introduced WKWebView, a modernised web view for iOS with more features, particularly notably JIT compilation for Javascript code which significantly improves performance.

However WKWebView on iOS 8 had some bugs which prevented Cordova using it by default. AFAIK there are plugins that can use it, but they all say "beta", "incomplete" etc. Also as far as I'm aware iOS 9 fixes the bugs that stopped Cordova defaulting to WKWebView in iOS 8.

So what is the state of WKWebView in Cordova on iOS 9? I can't seem to find any information about this. Does Cordova default to WKWebView on iOS 9? If not why not, and can it be officially enabled another way?

解决方案

New edit: 24 August 2016

Updated just to add a fork of the apache's WKWebView plugin created by the ionic framework team that adds some enhancements to the plugin.

https://github.com/driftyco/cordova-plugin-wkwebview-engine

The enhancements will probably land on the core plugin soon, but you can take a look and test the ionic fork now.

New edit: 9 December 2015

cordova ios 4.0.0 has been released and the version 1.0.0 of cordova-plugin-wkwebview-engine

To try it:

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

As I already told, cordova-plugin-wkwebview-engine only supports iOS 9, on iOS 8 it will use UIWebView and has some know issues

If you want to support iOS 8 too, you can use the wkwebview-engine-localhost (experimental) or cordova-plugin-wkwebview from Telerik, both of them use a local web server

https://github.com/apache/cordova-plugins/tree/master/wkwebview-engine-localhost

OLD MESSAGE:

You can use WKWebView with cordova using the WKWebView plugins available.

The problem you mention is that WKWebView can't load local files, so the plugins use a local web server to workaround the problem.

There are some of them like this one from telerik https://github.com/Telerik-Verified-Plugins/WKWebView (with the web server built in) or the official from cordova team https://github.com/apache/cordova-plugins/tree/master/wkwebview-engine-localhost (with the web server as dependency plugin)

As the bug you mention is fixed on iOS 9, the current cordova plugin (compatible with iOS 8 and iOS 9, using the web server) has been renamed to wkwebview-engine-localhost, and the current name cordova-plugin-wkwebview-engine will be used for a new plugin that will support iOS 9 only and won't use the web server

You can see the issues to track the progress here

https://issues.apache.org/jira/browse/CB-9566

https://issues.apache.org/jira/browse/CB-9567

EDIT: I bring news https://shazronatadobe.wordpress.com/2015/09/09/apache-cordova-ios-4-0-0-and-wkwebview-support/

WKWebView support

The cordova-plugin-wkwebview-engine plugin will be iOS 9 only and it will be a core plugin. The development of this updated plugin is still in progress. Apple has fixed the bug where we couldn’t load documents from file:// urls, and it is iOS 9 only. On non-iOS 9 devices, cordova-ios will fallback to using the UIWebView.

The old version of this plugin used a local webserver to load your main document. This older plugin can be used where you want to use WKWebView in both iOS 8 and iOS 9 deployments, but the plugin will remain as a cordova-labs experiment. This plugin has some re-factoring work to be done.

这篇关于Cordova iOS 9上的WKWebView状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆