TF-903: Open to other app using deeplink
This commit is contained in:
@@ -21,6 +21,14 @@
|
||||
<category android:name="android.intent.category.APP_BROWSER" />
|
||||
<data android:scheme="https" />
|
||||
</intent>
|
||||
<intent>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<data android:scheme="sms" />
|
||||
</intent>
|
||||
<intent>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<data android:scheme="tel" />
|
||||
</intent>
|
||||
</queries>
|
||||
|
||||
<application
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:url_launcher/url_launcher.dart' as launcher;
|
||||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
import 'package:webview_flutter/webview_flutter.dart';
|
||||
import 'dart:developer' as developer;
|
||||
|
||||
@@ -151,8 +152,11 @@ class _HtmlContentViewState extends State<HtmlContentViewer> {
|
||||
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;
|
||||
}
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
@@ -46,6 +46,8 @@
|
||||
<string>https</string>
|
||||
<string>http</string>
|
||||
<string>mailto</string>
|
||||
<string>sms</string>
|
||||
<string>tel</string>
|
||||
</array>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
|
||||
Reference in New Issue
Block a user