Cordova support for WkWebView in iOS8

Hey guys,

Sure you’re all patiently awaiting the arrival of WkWebView support in our Cordova apps. This should lead to a performance increase of up to 20% in our Ionic apps on iOS8 devices.

Unfortunately though there was a bug in iOS8 that made it impossible for Cordova to make use of this new webview. Cordova currently still defaults to the standard webview when building for iOS.

Luckily that bug has now been fixed in Webkit:

It’s now just a matter of time before Apple pushes this fix into an iOS update. When that happens, the Cordova team can update Cordova, which will then lead to faster Cordova based apps in iOS8. Let’s hope they pick up the pace :smile:


Unfortunately iOS 8.1 does not have this new API function, so maybe 8.2/8.3… And then cordova support needs to be finalised (quite a few items on the to do list).

So obviously some good news overall, but we’re still talking a few weeks (or most probably months) before this lands.

1 Like

Absolutely @pierre, support is definitely some weeks away at least. But it’s at least promising that the original bug that was leading to the most trouble is now squashed, even if it’s only webkit at this stage.

I wanted to create a thread where we can centralize information on this development as it’s spread out over so many layers (webkit / ios / cordova). When some progress is made on their fronts we can keep track of it for the Ionic community.

Excited about wkwebview as well! Even so excited I created a plugin to drop it in. Grab it while it’s beta and hopefully it’ll be obsolete soon!


Can you share some performance data? Because with the actual webview the RAM usage at start is up to 56 Mb more or less.

That’s an interesting question - I didn’t check this before, but it’s actually quite amazing:

I created a new Ionic app with the CLI and it generated the app with the ‘friends’ tab in the middle of the tabstrip. I then tapped a ‘friend’, then back, then a friend again, back, etc. While I was doing this, I observed this in XCode:

iPad 2 (non-Air) :
UIWebView (old):
CPU 70-100%
Memory 35 MB

WKWebView (new):
CPU 2-15%
Memory 5 MB

iPhone 6 :
UIWebView (old):
CPU 30-50%
Memory 40 MB

WKWebView (new):
CPU 2-8%
Memory 7 MB

So I think we’re good :blush:

1 Like

Wow, yeah, huge performance improvement.

I tried your plugin in a tabs app that I’m developing but I can’t get it work but if I start a new tabs application the plugin is working correctly.

I’d be glad to take a look at the one where it’s not working as it’s totally possible the plugin needs a specific bugfix for your setup. If you want, drop me an email at eddyverbruggen at gmail dot com.

Wow Eddy. I just used the plugin for that app of mine you looked at earlier. Without the plugin, I’m seeing memory usage of 40MB and CPU as high as 35% when scrolling intensively

With the plugin, I’m seeing memory as at 6.5M and CPU up to 7.5% when scrolling intensively. Those are massive improvements.

Does not work at the moment with AppBuilder.
Build missing Webkit.h files.

To bad :frowning:

I tried this plugin on my app which is a simple news feed pulled via json and I just get a white screen with a loading icon. No errors so pretty difficult to debug. Are there any other settings within ionic/xcode I need to configure?

edit: I’m seeing this in xcode output

2014-11-10 14:31:57.787 Sports Digest[706:307195] Using a WKWebView
Could not create a sandbox extension for '/'

Can you share your project with me perhaps? I’d love to take a look.

Update: Ha, you just created an issue at the repo. Let’s continue there.

Hey i am also getting same issue :frowning:

Using a WKWebView Could not create a sandbox extension for ‘/’

‘deviceready’ never fires. Can you tell me what went wrong please.

I am using cordova 3.6.3 with ionic beta.13. Everything works fine without this plugin.

After installing this plugin, my application is not sending request to server for authentication (external url). Request is returned with status code = 0. Any idea? !!!

Support (with some definite caveats) from Cordova is scheduled for April 2015!

1 Like