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" />
|
<category android:name="android.intent.category.APP_BROWSER" />
|
||||||
<data android:scheme="https" />
|
<data android:scheme="https" />
|
||||||
</intent>
|
</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>
|
</queries>
|
||||||
|
|
||||||
<application
|
<application
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import 'package:flutter/foundation.dart';
|
|||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart' as launcher;
|
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 'package:webview_flutter/webview_flutter.dart';
|
||||||
import 'dart:developer' as developer;
|
import 'dart:developer' as developer;
|
||||||
|
|
||||||
@@ -151,8 +152,11 @@ class _HtmlContentViewState extends State<HtmlContentViewer> {
|
|||||||
await urlDelegate(Uri.parse(url));
|
await urlDelegate(Uri.parse(url));
|
||||||
return NavigationDecision.prevent;
|
return NavigationDecision.prevent;
|
||||||
}
|
}
|
||||||
if (await launcher.canLaunch(url)) {
|
if (await launcher.canLaunchUrl(Uri.parse(url))) {
|
||||||
await launcher.launch(url);
|
await launcher.launchUrl(
|
||||||
|
Uri.parse(url),
|
||||||
|
mode: LaunchMode.externalApplication
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return NavigationDecision.prevent;
|
return NavigationDecision.prevent;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -62,7 +62,7 @@ dependencies:
|
|||||||
webview_flutter: 3.0.0
|
webview_flutter: 3.0.0
|
||||||
|
|
||||||
# url_launcher
|
# url_launcher
|
||||||
url_launcher: 6.0.17
|
url_launcher: 6.1.5
|
||||||
|
|
||||||
# collection
|
# collection
|
||||||
collection: 1.16.0
|
collection: 1.16.0
|
||||||
|
|||||||
@@ -46,6 +46,8 @@
|
|||||||
<string>https</string>
|
<string>https</string>
|
||||||
<string>http</string>
|
<string>http</string>
|
||||||
<string>mailto</string>
|
<string>mailto</string>
|
||||||
|
<string>sms</string>
|
||||||
|
<string>tel</string>
|
||||||
</array>
|
</array>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
|||||||
Reference in New Issue
Block a user