From 2154195a66ef5ef0fda75ac674e74152babb8ba9 Mon Sep 17 00:00:00 2001 From: ManhNTX Date: Mon, 12 Sep 2022 06:38:04 +0700 Subject: [PATCH] TF-903: Open to other app using deeplink --- android/app/src/main/AndroidManifest.xml | 8 ++++++++ .../views/html_viewer/html_content_viewer_widget.dart | 8 ++++++-- core/pubspec.yaml | 2 +- ios/Runner/Info.plist | 2 ++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 0ec5994e3..2594793d2 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -21,6 +21,14 @@ + + + + + + + + { await urlDelegate(Uri.parse(url)); return NavigationDecision.prevent; } - if (await launcher.canLaunch(url)) { - await launcher.launch(url); + if (await launcher.canLaunchUrl(Uri.parse(url))) { + await launcher.launchUrl( + Uri.parse(url), + mode: LaunchMode.externalApplication + ); } return NavigationDecision.prevent; } diff --git a/core/pubspec.yaml b/core/pubspec.yaml index 3b7f9bc99..a4a9975ed 100644 --- a/core/pubspec.yaml +++ b/core/pubspec.yaml @@ -62,7 +62,7 @@ dependencies: webview_flutter: 3.0.0 # url_launcher - url_launcher: 6.0.17 + url_launcher: 6.1.5 # collection collection: 1.16.0 diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 2be79e3ac..85d643c04 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -46,6 +46,8 @@ https http mailto + sms + tel LSRequiresIPhoneOS