From c3b10d6c45b301da03379f10abd46adce8547331 Mon Sep 17 00:00:00 2001 From: edde746 <86283021+edde746@users.noreply.github.com> Date: Mon, 16 Feb 2026 04:21:44 +0100 Subject: [PATCH] fix: fallback to external browser when Custom Tabs unavailable --- lib/screens/auth_screen.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/screens/auth_screen.dart b/lib/screens/auth_screen.dart index 4ae59327..18d8702d 100644 --- a/lib/screens/auth_screen.dart +++ b/lib/screens/auth_screen.dart @@ -156,7 +156,13 @@ class _AuthScreenState extends State { if (await canLaunchUrl(uri)) { // On TV, use inAppWebView (simpler WebView) instead of Chrome Custom Tabs final mode = PlatformDetector.isTV() ? LaunchMode.inAppWebView : LaunchMode.inAppBrowserView; - await launchUrl(uri, mode: mode); + try { + await launchUrl(uri, mode: mode); + } catch (_) { + // Chrome Custom Tabs may not be available (e.g. no Chrome installed). + // Fall back to opening in the default external browser. + await launchUrl(uri, mode: LaunchMode.externalApplication); + } } else { throw Exception(t.errors.couldNotLaunchUrl); }