WKWebView and Apache Cordova
The Good
WKWebView support will be coming in cordova-ios 4.0.0, tentatively scheduled for April 2015. You can however, alpha test the support by following this README.
Pluggable webviews are coming in cordova-ios 4.0.0, which in addition to the default UIWebView, you can include the wkwebview-engine plugin for WKWebView support (it will not be in there by default so as not to break your existing code). The default uiwebview-engine has also been pluginized as well, which allows scenarios where you can update it with bug fixes after a platform release, or substituting it as the default webview for wkwebview-engine in the future.
cordova-ios 4.0.0 is still a work in a progress, and the APIs are subject to change. Rest assured that all core plugins will be compatible before we release, and we’ll test a bunch of the top plugins from plugins.cordova.io as well.
The Bad
Unfortunately for the WKWebView in iOS 8, support for loading local files in the app bundle is not available (yet). The code has been patched in WebKit2, but the patch hasn’t been downstreamed into iOS yet. As of iOS 8.3 beta 2, the functionality is still not available. So, we’ve decide to use the embedded local web-server route. Because of this, the File core plugin and the Camera core plugin might not work yet (fixes are coming) — we have a solution that transforms file:/// references to the appropriate http://localhost routes.
The Ugly
So WKWebView is great right? Yup! But there are limitations to its behaviour as compared to UIWebView:
Help Test!
Instructions here. Please file issues and assign them to me. Thanks everyone 🙂
Of course, lack of AppCache support shouldn’t really matter, right? 🙂
Raymond Camden
March 3, 2015 at 3:32 pm
Not to Cordova, it’s just a general WKWebView limitation…
shazron
March 25, 2015 at 10:55 pm
I am authenticating my session on my external server by setting a cookie on the client browser. This cookie no longer seems to be sent from my app to my server. How does the embedded server handle cookies from the WKWebView to the external server?
Jeremy
March 21, 2015 at 9:21 am
It should still handle cookies (you just can’t delete them from any interface). Any deficiency you encounter would sadly be WKWebView’s fault, not sure of a workaround.
shazron
March 25, 2015 at 10:56 pm
Is cordova-ios 4.0.0 still on track for an April release?
benchun (@benchun)
April 2, 2015 at 12:49 am
Hey, any word on the fixes for the file core and camera plugins to work with http?
Jeremy
April 15, 2015 at 8:46 pm
Hi, any news on the schedule for the cordova-ios 4.0.0 release?
Atte
May 18, 2015 at 9:04 am
Follow the board here: https://issues.apache.org/jira/secure/RapidBoard.jspa?rapidView=76
Unfortunately, no ETA — currently alone working on this, plus other modules.
shazron
May 18, 2015 at 9:50 pm
Thanks for link! Keep up the good work.
Atte
May 19, 2015 at 5:36 am
+1 on the value of the cordova-ios 4.0.0 release. I appreciate your work!
Ryan
June 26, 2015 at 1:27 pm
Hi,
Do you have any update on the release date? I did try the plugin with cordova ios4dev but my application does not get loaded! is there anything I can do to know why? nothing wrong in the logs!
fadi al-katout
July 8, 2015 at 3:45 pm
Now that the local file bug is fixed in iOS9; is there a planned date for 4.0 release with wkwebview?
AG
August 18, 2015 at 4:47 am
There’s currently a serious problem with uiWebView in iOS9, which (naturally) is affecting Cordova Apps. Specifically it completely breaks breaks routing in AngularJS apps (and by association ionic framework):
https://github.com/angular/angular.js/issues/12635
Obviously this isn’t a Cordova issue, it’s an Apple issue, but it does rather raise the urgency of moving over to WKWebView / cordova-ios 4. Especially given that many existing in-the-wild apps are broken as of iOS9 (unless Apple fixes it).
Is there any news on WKWebView?
ad3r0wb0tham
August 31, 2015 at 11:03 am
See news at: https://shazronatadobe.wordpress.com/2015/09/09/apache-cordova-ios-4-0-0-and-wkwebview-support/
shazron
September 9, 2015 at 6:24 am
[…] we missed the proposed deadline, by a […]
Apache Cordova iOS 4.0.0, and WKWebView support | Shazron's Cordova (aka PhoneGap) Blog
September 9, 2015 at 6:23 am
Great, thanks for the update!
ad3r0wb0tham
September 9, 2015 at 8:11 am
[…] get a sense for its need and history. Although the SDK has been updated and WKWebview is present it doesn’t appear to be a very easy fit for frameworks like Cordova just yet. Work still has to be done as it appears, but they’re getting […]
EeKay's Blog | Using WKWebView for your hybrid iOS apps
September 18, 2015 at 3:01 pm
[…] pattern lately of breaking more and more Cordova/Hybrid compatibility in their new iOS releases, WkWebView in iOS8 and now Url’s with hash’swindow.location in iOS9. When Apple uses the slogan […]
Design Limbo » Ionic Framework as a Web Site
October 6, 2015 at 5:02 pm