ionic-team / cordova-plugin-ionic-webview

Web View plugin for Cordova, specialized for Ionic apps.
Apache License 2.0
487 stars 395 forks source link

Using Chrome webview on iOS instead of WKWebview #654

Open itziksha opened 2 years ago

itziksha commented 2 years ago

Hi,

This plugin uses WKWebView on iOS and the latest evergreen webview on Android.

iOS 15 has a problem with playing WebRTC playback, so our app video is now broken. WebRTC works on Ionic in Android and also on Chrome browser in iOS, but not on Safari or on our Ionic app with WKWebView.

I'm pretty sure about the answer, but we want to make sure anyway :) Is it possible to use Chrome as a WebView on iOS, instead of WKWebview, in Ionic app?

Thanks.

oddcb commented 2 years ago

Hi. I think Chrome on iOS also uses Wkwebview due to Apple policies. So does Firefox and all other alternative browsers.

Don't know if it is related - but check if iOS 15 fixes the issue? Ref: https://developer.apple.com/forums/thread/692214 / https://github.com/ionic-team/ionic-framework/issues/23997

ghenry22 commented 2 years ago

@itziksha there is no way to choose the webview on iOS you just get wkwebview.

As @oddcb has mentioned, I'm also pretty sure chrome/firefox etc on iOS also use the same underlying wkwebview. If it works on one of those there may well be a way to work around the issue in your app also.

Smizz1609 commented 2 years ago

@ghenry22 Is there any way to use chrome engine(web) on the ionic application? Instead of an Android web view?

oddcb commented 2 years ago

@Smizz1609 On Android the webview is based on Chrome/Chromium since Android 4.4. (https://developer.chrome.com/docs/multidevice/webview/)

If you need to open a webpage inside your app the best bet is either inappbrowser plugin or cordova-plugin-safariviewcontroller (also works on Android). cordova-plugin-safariviewcontroller pops up a webbrowserish view of the requested webpage and presents some simple controls to the user for navigation.

oliveryasuna commented 4 weeks ago

I know this is old, but just to share some insight...

As far as I know, all current web browsers on iOS use WKWebView (or legacy classes). WKWebView is basically WebKit on iOS. Until early 2024, Apple required developers use their 1st-party WebKit. However, in early 2024, the EU basically forced Apple to allow alternative browser engines. Custom browser engines are allowed in the EU only, not in the US, so I doubt we will see heavy adoption anytime soon. However, Google seems to be working on one: https://9to5google.com/2023/02/06/google-chrome-blink-ios-webkit/.

More information: https://developer.apple.com/support/alternative-browser-engines/.

Regarding this issue, I could see a world where the Capacitor developers abstract all logic pertaining to the web view, which would enable developers to support alternative browser engines.