mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-12 19:17:58 +00:00
fix: uni links failed to be invoked with --cm running on macOS
This commit is contained in:
@@ -1292,14 +1292,24 @@ Future<bool> initUniLinks() async {
|
||||
}
|
||||
}
|
||||
|
||||
StreamSubscription? listenUniLinks() {
|
||||
if (!(Platform.isWindows || Platform.isMacOS)) {
|
||||
/// Listen for uni links.
|
||||
///
|
||||
/// * handleByFlutter: Should uni links being handled by Flutter.
|
||||
///
|
||||
/// Returns a [StreamSubscription] which can listen the uni links.
|
||||
StreamSubscription? listenUniLinks({handleByFlutter = true}) {
|
||||
if (Platform.isLinux) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final sub = uriLinkStream.listen((Uri? uri) {
|
||||
debugPrint("A uri was received: $uri.");
|
||||
if (uri != null) {
|
||||
callUniLinksUriHandler(uri);
|
||||
if (handleByFlutter) {
|
||||
callUniLinksUriHandler(uri);
|
||||
} else {
|
||||
bind.sendUrlScheme(url: uri.toString());
|
||||
}
|
||||
} else {
|
||||
print("uni listen error: uri is empty.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user