Is it possible to use WKWebView with Cordova CLI?

Discussion and feedback on Construct 2

Post » Mon Jul 04, 2016 4:49 pm

I've been using Cordova CLI to build my apps up until now, but lately I've realised I can seem to get WKWebView working.

When I tick the option to use WKWebView, then run it in Xcode, I can see that it is still using UIWebView. I've tried adding the WK plugin with Cordova, also the file and http plugins. If I add the WK engine plugin, the app runs in WK mode but all I get is a black screen.

Is it only possible to use Phonegap at the moment? I've tried to have a look around but I can't find a guide to using WKWebView anywhere apart from the r224 release notes, does anyone know if there's something I could read that would help?
B
6
S
1
Posts: 50
Reputation: 500

Post » Mon Jul 04, 2016 9:14 pm

You need to make sure you use all the same settings and plugins as is specified in config.xml when exporting for Cordova from C2. Also it only works with CLI 6.0+.
Scirra Founder
B
395
S
232
G
88
Posts: 24,368
Reputation: 193,756

Post » Sun Jul 17, 2016 1:02 pm

Still having problems with this. I'm sure it's my fault though! At the moment this is the process I do:

• Create cordova project

• Add iOS platform

• Add plugins:

crosswalk-webview
wkwebview-engine
file
httpd
whitelist
inappbrowser

• Build project

• Run with Xcode, it's always worked fine with uiwebview, but wkwebview always just gives me the black screen.


I'm using CLI 6.2.0

Should i take the config.xml file out of the www folder and put it in the main project folder before building? I've tried it both ways.
B
6
S
1
Posts: 50
Reputation: 500

Post » Mon Jul 18, 2016 10:41 am

If the CLI accepts the config.xml produced by C2, you should definitely use it - it specifies several other options like target OS versions and some preferences that might also be necessary. I'm pretty sure PhoneGap Build uses the CLI and that works fine, so it's probably just a matter of getting your CLI to build the same as PhoneGap Build uses it.
Scirra Founder
B
395
S
232
G
88
Posts: 24,368
Reputation: 193,756


Return to Construct 2 General

Who is online

Users browsing this forum: Tinimations and 8 guests