Cordova + Crosswalk iOS still using UIWebView(Cordova + Crosswalk iOS 仍在使用 UIWebView)
问题描述
我没有找到很多为 iOS 设置人行横道的说明,看起来应该很简单:
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
完成此操作后,当我捕获视图层次结构并检查它是否仍在使用其中有一个UIWebBrowserView"的UIWebView"(它位于滚动视图内部并且也有几个图像视图).
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).
另外,navigator.userAgent 如下:
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');
而且 window.indexedDB 是未定义的.
And window.indexedDB is undefined.
那么...我需要做什么才能让应用使用 wkwebview?
So... what do I need to do so that the app uses wkwebview?
推荐答案
我是如何解决这个问题的
正如 JesseMonroy 如此乐于助人的回答(请随时为他投票)cordova 人行横道插件仅适用于 android.
由于 Apple 的服务条款,iOS 版的crosswalk 使用 wkwebview 代替,而非 ios 版的 chrome 会使用.
Because of apple's terms of service, crosswalk for iOS uses wkwebview instead of what non-ios version of chrome would use.
由于我知道没有适用于 crosswalk iOS 的 cordova 插件,我找到了适用于 WKWebView 的插件
Since there is no cordova plugin I know of for crosswalk iOS, I found plugins for WKWebView
我使用的插件是:https://github.com/Telerik-Verified-Plugins/WKWebView
这可能是更好的选择:https://github.com/apache/cordova-plugin-wkwebview-engine.. 但是我出错了.
This is probably a better option: https://github.com/apache/cordova-plugin-wkwebview-engine.. But it errored for me.
正如 Honry 所说:
As stated by Honry:
Crosswalk 将很快为 Crosswalk ios 提供一个 cordova 插件,请参阅票 https://crosswalk-project.org/jira/browse/XWALK-4911
Crosswalk will soon provide a cordova plugin for Crosswalk ios, see ticket https://crosswalk-project.org/jira/browse/XWALK-4911
XWalk 毕竟不会支持 iOS 插件,因为它没有提供任何优于 wkwebview 的必备优势
XWalk will not be supporting an iOS plugin afterall because it does not provide any must have advantages over wkwebview
这篇关于Cordova + Crosswalk iOS 仍在使用 UIWebView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Cordova + Crosswalk iOS 仍在使用 UIWebView


基础教程推荐
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01