Cordova + Crosswalk iOS仍然使用UIWebView [英] Cordova + Crosswalk iOS still using UIWebView
问题描述
我没有找到很多的指令设置人行横道的iOS它似乎应该像以下简单:
cordova plugin add cordova-plugin-crosswalk-webview
cordova build ios
我有以下问题插件不生效我做以下:
cordova插件add cordova-plugin-crosswalk-webview
cordova platform remove ios
cordova platform add ios
cordova build ios
完成后,当我捕获视图层次结构,并检查它仍然使用UIWebView,其中有一个UIWebBrowserView(它是在滚动视图内,并有一对夫妇的图像视图)。
此外,navigator.userAgent如下:
Mozilla / 5.0 iPad; CPU OS 9_1,如Mac OS X)AppleWebKit / 601.1.46(KHTML,like Gecko)Mobile / 13B143(5618403776)= $ 1
有人提到的另一个测试基本上是:
if(window.indexedDB)
console.log('Using crosswalk');
else
console.log('不使用crosswalk / wkwebview');
且window.indexedDB未定义。
我如何解决问题 h2>
由于JesseMonroy如此乐于回答(随意升级他), cordova crosswalk插件只适用于android 。
由于苹果的服务条款,针对iOS的crosswalk会使用wkwebview 来替换Chrome将使用的非ios版本。
由于没有cordova插件我知道对于crosswalk的iOS,我发现插件WKWebView
我使用的插件:
https://github.com/Telerik-Verified-Plugins/ WKWebView
这可能是更好的选项: https://github.com/apache/cordova-plugin-wkwebview-engine ..但它错误了我。
即将推出:
:
Crosswalk将很快提供Crosswalk ios的cordova插件,请参阅
ticket https://crosswalk-project.org/jira/browse/XWALK-4911
XWalk将不再支持iOS插件,因为它不提供任何必要的优点wkwebview
I didn't find a lot of instruction setting up crosswalk for iOS it seems like it should be as simple as:
cordova plugin add cordova-plugin-crosswalk-webview
cordova build ios
Because I've had issues with plugins not taking effect before I do the following:
cordova plugin add cordova-plugin-crosswalk-webview
cordova platform remove ios
cordova platform add ios
cordova build ios
After having done this, when I capture the view hierarchy and inspecting that it's still using "UIWebView" which has a "UIWebBrowserView" inside of it (which is inside of a scroll view and there are a couple image views too).
Also, navigator.userAgent is as follows:
"Mozilla/5.0 (iPad; CPU OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13B143 (5618403776)" = $1
Another test someone mentioned was essentially:
if (window.indexedDB)
console.log('Using crosswalk');
else
console.log('Not using crosswalk/wkwebview');
And window.indexedDB is undefined.
So... what do I need to do so that the app uses wkwebview?
How I solved the issue
As JesseMonroy so helpfully answered(feel free to upvote him) the cordova crosswalk plugin is only for android.
Because of apple's terms of service, crosswalk for iOS uses wkwebview instead of what non-ios version of chrome would use.
Since there is no cordova plugin I know of for crosswalk iOS, I found plugins for WKWebView
The plugin I used was: https://github.com/Telerik-Verified-Plugins/WKWebView
This is probably a better option: https://github.com/apache/cordova-plugin-wkwebview-engine.. But it errored for me.
Coming soon:
As stated by Honry:
Crosswalk will soon provide a cordova plugin for Crosswalk ios, see ticket https://crosswalk-project.org/jira/browse/XWALK-4911
XWalk will not be supporting an iOS plugin afterall because it does not provide any must have advantages over wkwebview
这篇关于Cordova + Crosswalk iOS仍然使用UIWebView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!