cordova
I have created a cordova project adding 2 platforms (android, ios) with some plugin. One of them is the last cordova-plugin-crosswalk-webview (1.3.1). I have chose iOS8 and android 4.0 like target android. Everything work well, i can build the android platform and the iOS too.
On my config.xml file this line are automatical added:
...
<preference name="xwalkVersion" value="14+" />
<preference name="xwalkCommandLine" value="--disable-pull-to-refresh-effect" />
<preference name="xwalkMode" value="embedded" />
...
For android i'm sure to use the crosswalk plugin. With Chrome inspector i can see the navigator.userAgent setted to Crosswalk similar to this image
My package android-debug.apk is now splitted in android-debug-armv7.apk and android-debug-x86.apk and the apk size is near to 25Mb.
But for iOS i can't undestand if crosswalk is working or not. On the safari inspector of my iOS Virtual Machine the navigator.userAgent variable is:
"Mozilla/5.0 (iPhone; CPU iPhone OS 8_4 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12H141 (140222960683616)"
How i can be sure of what browser i'm runnig on my iOS? And, if the config.xml configuration is not enought, how i can set crosswalk-webview fos iOS?
I have read the quick start guide of crosswalk for iOS but i think that is not so understandable for who use cordova CLI normally. And nothing is written on documentation of cordova-plugin-crosswalk-webview npm package.
UPDATE:
Follow the cordova output:
$ cordova plugin list
cordova-plugin-crosswalk-webview 1.3.1 "Crosswalk WebView Engine"
$ cordova platforms add ios
Adding ios project...
iOS project created with cordova-ios@3.9.2
Running command: /Users/jedi/prj/appMobile/hooks/after_prepare/010_add_platform_class.js /Users/jedi/prj/appMobile
add to body class: platform-ios
Running command: /Users/jedi/prj/appMobile/hooks/after_prepare/030_resource_files.js /Users/jedi/prj/appMobile
...
Installing "cordova-plugin-console" for ios
Installing "cordova-plugin-crosswalk-webview" for ios
Installing "cordova-plugin-device" for ios
..
iOS上的WKWebView
使用原生WKWebView
,它具有indexedDB支持,你可以运行这个javascript代码来检查它是否是WKWebView
if (window.indexedDB) {
alert('WKWebView');
} else {
alert('UIWebView');
}
The cordova crosswalk plugin only adds cross walk for android.
Note that crosswalk for iOS is required to use webkit for apps on the app store, so it essentially uses WKWebView. (It uses webkit instead of the usual blink engine chrome is based on)
See Jesse's response to my question: Cordova + Crosswalk iOS still using UIWebView
链接地址: http://www.djcxy.com/p/29732.html下一篇: 科尔多瓦