-
Notifications
You must be signed in to change notification settings - Fork 5
Upgrade Cordova UIWebView to WKWebView for iOS 9 #94
Comments
https://cordova.apache.org/announcements/2015/12/08/cordova-ios-4.0.0.html
|
Getting
UPDATE
*Also remember to disable it on 'config.xml' otherwise it will be automatically reinstalled:
But after removing & disabling Camera plugin in PostcardApp I still got the same build error:
Tested config and plugins in new project and it build ok (without Camera plugin). Maybe old plugin to blame? |
Camera plugin ios@4 build issue has been reported on Jira: |
Reverting back to cordova-ios@3.9.2 for now |
@deadlyfingers I figured out the issue. If you did the following: $ cordova plugin ls
cordova-plugin-camera 1.2.0 "Camera"
cordova-plugin-whitelist 1.2.0 "Whitelist" You need to update the camera plugin to 2.0.0 with the following: $ cordova plugin add cordova-plugin-camera@2 Then everything should build just fine and your list should look like this: $ cordova plugin ls
cordova-plugin-camera 2.0.0 "Camera"
cordova-plugin-whitelist 1.2.0 "Whitelist" |
Ok, finally got BUILD SUCCEEDED! So I was still getting Cordova build failed error on my Mac (Xcode v 7.2)...
How I got the build working:
Also remove iOS platform and update Android platform to v 5.0 to support the new camera plugin.
Then try build for iOS:
|
WKWebKit works but having an issue with cross-document messaging to trigger Cordova Camera function from iframe -
Also noticed this in the Xcode logs:
|
Posting cross-document messages within an iframe with the targetOrigin as 'file://' worked under the UIWebView but WKWebView was giving me a null value here. The only way I found I could get working was to change the targetOrigin to |
Note: I can trigger the camera to take a picture but sometimes I get stuck on a white screen after choosing 'Use Photo'. I've created a separate issue for this #104. cordova-plugin-camera@2.0.0 seems to be the latest version atm: Update: iOS 4.0.1 and cordova-plugin-wkwebview-engine@1.0.1 are out which fixes icon paths and DisallowOverscroll.
|
So far I have only found two UX side-effects with the web app since updating to WKWebView - i. It appears the entire webpage or iframe can be scaled using a pinch gesture. This seems to be fixed by setting user-scalable equals 'no' on the main index.html page.
ii. Editing textfield causes view to scroll up. I had a CSS hack to stop this happening with UIWebView but this sweet hack no longer works with WKWebView. The sheer performance gain in WKWebView will provide overall better UX - especially fast scrolling which is buttery smooth even with photos in the iron-list. So it's worth the extra effort! |
@deadlyfingers the problem here is that the protocols must match where you have |
Cordova WKWebView plugin for iOS 9:
https://github.com/apache/cordova-plugin-wkwebview-engine
Should deliver performance equivalent of mobile Safari engine - notably it should mean smoother scrolling of Polymer's iron-list with 20+ items.
We should add this once cordova-ios 4.0.0 and the plugin is released on npm.
The text was updated successfully, but these errors were encountered: