gree / unity-webview

zlib License
2.29k stars 691 forks source link

using chrome custom tabs instead of webview #182

Closed jose-castillo closed 7 years ago

jose-castillo commented 7 years ago

It looks like it is way faster and since it is chrome all the problems with css and javascript we have may go away...

KojiNakamaru commented 7 years ago

Chrome Custom Tabs differ from WebView in the perspective of UX. Also WebView on recent Android is based on Chrome so css/javascript don't have issues in old days.

jose-castillo commented 7 years ago

Yes, that is true, but for example in our case, we are using it to service android 4.1+ (as unity does). in this case we find many inconvenients with css/javascript on 4.1 - 4.3 phones. thus the recommendation

KojiNakamaru commented 7 years ago

As Chrome Custom Tabs differs from WebView and cannot cover many use cases that this plugin supports, it should not be considered in this plugin. You can separately create another plugin for Chrome Custom Tabs.

About javascript/css issues, basically you should make portable/conservative code for them so that they work well on various versions of Android.

jose-castillo commented 7 years ago

Thanks. We are solving it by usign xWalkView.

ninjakatz commented 7 years ago

hi @jose-castillo , we are also thinking on a way of using crosswalk webview with unity app. Do you mind sharing some of your knowledge on the subject? thanks!

jose-castillo commented 7 years ago

Sure!

I did not implement it myself but it is quite straightforward.

On the webview plugin instead of using the android webview implementation you have to use xwalkview. Maybe this link can show you how: https://stackoverflow.com/questions/33228274/is-there-a-xwalkview-webviewclient

We had some problems with the following things: 1) Library detection: Even if you import the xwalkview into the webview library, unity does not detect it. Thus, you have to import the necessary JARs into unity's plugin folder 2) App File Size: Importing the necessary libraries increases the apk file size about 30 Mb (not recommended for heavy games) 3) Webview Display Problems: There are some implementations of html tags that are not included into xwalkview. For example the