Cordova + Crosswalk iOS still using UIWebView
Asked Answered
D

3

5

I didn't find a lot of instruction setting up crosswalk for iOS it seems like it should be as simple as:

cordova plugin add cordova-plugin-crosswalk-webview
cordova build ios

Because I've had issues with plugins not taking effect before I do the following:

cordova plugin add cordova-plugin-crosswalk-webview
cordova platform remove ios
cordova platform add ios
cordova build ios

After having done this, when I capture the view hierarchy and inspecting that it's still using "UIWebView" which has a "UIWebBrowserView" inside of it (which is inside of a scroll view and there are a couple image views too).

Also, navigator.userAgent is as follows:

"Mozilla/5.0 (iPad; CPU OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13B143 (5618403776)" = $1

Another test someone mentioned was essentially:

if (window.indexedDB)
    console.log('Using crosswalk');
else
    console.log('Not using crosswalk/wkwebview');

And window.indexedDB is undefined.

So... what do I need to do so that the app uses wkwebview?

Drogheda answered 18/11, 2015 at 23:29 Comment(1)
Somebody voted to close this because it's asking to find a "tool"; and as a result answers are biased. My original intent was not to ask for a tool to be found, I thought "Crosswalk"'s cordova plugin would you know... work on more platforms than just Android cause that's the point of crosswalk. Anyway, I think the answers have not been subjective, and are helpful to those whom may read this looking for answers similar to mine.Drogheda
D
5

How I solved the issue

As JesseMonroy so helpfully answered(feel free to upvote him) the cordova crosswalk plugin is only for android.

Because of apple's terms of service, crosswalk for iOS uses wkwebview instead of what non-ios version of chrome would use.

Since there is no cordova plugin I know of for crosswalk iOS, I found plugins for WKWebView

The plugin I used was: https://github.com/Telerik-Verified-Plugins/WKWebView

This is probably a better option: https://github.com/apache/cordova-plugin-wkwebview-engine.. But it errored for me.


Coming soon:

As stated by Honry:

Crosswalk will soon provide a cordova plugin for Crosswalk ios, see ticket https://crosswalk-project.org/jira/browse/XWALK-4911

XWalk will not be supporting an iOS plugin afterall because it does not provide any must have advantages over wkwebview

Drogheda answered 22/11, 2015 at 6:8 Comment(1)
I also tried to find a Crosswalk iOS cordova plugin and finally gave up and used cordova-plugin-wkwebview-engine, which worked well for me.Amphiprostyle
D
13

A review of the plugin repository does NOT indicate a cordova-plugin-crosswalk-webview that supports iOS. This means crosswalk does not work as a plugin for iOS.

Yes there is support for Crosswalk for iOS, but you must install via the github repository or other means.

FWIW: there is a WkWebview plugin

UPDATE: 2016-03-19. The follow post was made on February 16, 2016:
Plugins From Git Repositories Are Now Available on PhoneGap Build!

Duro answered 19/11, 2015 at 1:11 Comment(2)
Thanks, that makes sense. I +1'd your answer but I will probably write an answer with instructions on how to incorportate crosswalk for ios with cordova once I figure that out. (Or if you appended that sort of instructions I would accept your answer). Regardless your information was very helpful and appreciatedDrogheda
Yeah. Thanks for the offer. My plate is full. If you write an answer, I will get it out to the bloggers.Duro
D
5

How I solved the issue

As JesseMonroy so helpfully answered(feel free to upvote him) the cordova crosswalk plugin is only for android.

Because of apple's terms of service, crosswalk for iOS uses wkwebview instead of what non-ios version of chrome would use.

Since there is no cordova plugin I know of for crosswalk iOS, I found plugins for WKWebView

The plugin I used was: https://github.com/Telerik-Verified-Plugins/WKWebView

This is probably a better option: https://github.com/apache/cordova-plugin-wkwebview-engine.. But it errored for me.


Coming soon:

As stated by Honry:

Crosswalk will soon provide a cordova plugin for Crosswalk ios, see ticket https://crosswalk-project.org/jira/browse/XWALK-4911

XWalk will not be supporting an iOS plugin afterall because it does not provide any must have advantages over wkwebview

Drogheda answered 22/11, 2015 at 6:8 Comment(1)
I also tried to find a Crosswalk iOS cordova plugin and finally gave up and used cordova-plugin-wkwebview-engine, which worked well for me.Amphiprostyle
L
2

Crosswalk will soon provide a cordova plugin for Crosswalk ios, see ticket https://crosswalk-project.org/jira/browse/XWALK-4911

Limpid answered 24/11, 2015 at 6:0 Comment(6)
That is good, thanks for the post. I'll look forward to using this plugin when it becomes available.Drogheda
Looks like it won't happen: "we are not going to implement it, as Crosswalk iOS XWalkView does not provide more feature than the system WKWebView when it is used as a Cordova plugin webview."Bask
@Bask where did you quote that from ?Grimaud
@Vince: it's one of the comments of the ticket.Bask
They closed it as "won´t fix" :/Razee
Crosswalk will have no more releases: crosswalk-project.org/blog/crosswalk-final-release.htmlSaucy

© 2022 - 2024 — McMap. All rights reserved.