diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e1ff8c3..182bc944 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Upgraded to Flutter 3.13.5 - Upgraded macos runner version to 13 in Github actions - Added open.yivi.app to associated domains +- Use launchUrl instead of launch from url_launcher since the latter is deprecated - Upgraded packages and fixed various analyzer warnings ## [7.5.0] - 2023-09-13 diff --git a/lib/src/data/irma_repository.dart b/lib/src/data/irma_repository.dart index ad00af2d..b4975459 100644 --- a/lib/src/data/irma_repository.dart +++ b/lib/src/data/irma_repository.dart @@ -570,7 +570,9 @@ class IrmaRepository { if (Platform.isAndroid) { await _iiabchannel.invokeMethod('open_browser', url); } else { - final hasOpened = await launch(url, forceSafariVC: true); + final uri = Uri.parse(url); + final hasOpened = await launchUrl(uri, mode: LaunchMode.inAppWebView); + // Sometimes launch does not throw an exception itself on failure. Therefore, we also check the return value. if (!hasOpened) { throw Exception('url could not be opened: $url'); @@ -583,7 +585,9 @@ class IrmaRepository { _resumedFromBrowserSubject.add(true); } // On iOS, open Safari rather than Safari view controller - final hasOpened = await launch(url, forceSafariVC: false); + final uri = Uri.parse(url); + final hasOpened = await launchUrl(uri, mode: LaunchMode.externalApplication); + // Sometimes launch does not throw an exception itself on failure. Therefore, we also check the return value. if (!hasOpened) { throw Exception('url could not be opened: $url');