0

I'm currently working on a Flutter app that requires third-party authentication, and the authentication flow needs to be completed in a browser. Previously, I used a WebView to achieve this, but the support for WebView has changed, and now only custom tabs for Chrome and Samsung browsers are supported on Android.

For authentication, I'm using the InAppWebView package, specifically the ChromeSafariBrowser for Safari and Chrome. This works well for users who have Chrome as their default browser, but I'm facing issues with users who don't use Chrome.

Here's the problem I'm encountering: When trying to open the authentication flow on Android without Chrome (iOS works without any issues), I encounter the following error:

PlatformException(ChromeBrowserManager, ChromeCustomTabs is not available!, null, null)

I'm seeking guidance on how to handle this specific case, but I'm particular interested in solutions that would work for all three: Safari, Chrome and Samsung Browser users.

The error is also present when the Chrome browser is installed but not the default. How should i best handle this? Also from the perspective of my end users eg. feedback.

Please let me know if you have any suggestions or solutions to share.

Malou
  • 26
  • 3

1 Answers1

0

I made a terribly(all over the place) coded app before which used Webview to complete third-party(browser based)authentication. I just tried it again for you and it still works, even tho I don't have chrome on my phone. I think same approach may help you.

I used webview_flutter package. First, I get login details and save it to a variable, then, I launch a webview and paste login credentials & click login button via Javascript.

For the package, check this link: https://pub.dev/packages/webview_flutter

For my terrible code, check here: https://github.com/KatayR/googleAkademiMobilUygulama/blob/master/lib/webView_File.dart

If you need further help, just ask and I'll be glad to help.

Katay
  • 36
  • 5