diff --git a/lib/pages/chat_list/chat_list.dart b/lib/pages/chat_list/chat_list.dart index 2fcccca7..7632fbfc 100644 --- a/lib/pages/chat_list/chat_list.dart +++ b/lib/pages/chat_list/chat_list.dart @@ -7,6 +7,7 @@ import 'package:flutter/services.dart'; import 'package:adaptive_dialog/adaptive_dialog.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart'; +import 'package:flutter_shortcuts/flutter_shortcuts.dart'; import 'package:future_loading_dialog/future_loading_dialog.dart'; import 'package:go_router/go_router.dart'; import 'package:matrix/matrix.dart'; @@ -399,6 +400,16 @@ class ChatListController extends State FluffyChatApp.gotInitialLink = true; getInitialLink().then(_processIncomingUris); } + + if (PlatformInfos.isAndroid) { + final shortcuts = FlutterShortcuts(); + shortcuts.initialize().then( + (_) => shortcuts.listenAction((action) { + if (!mounted) return; + UrlLauncher(context, action).launchUrl(); + }), + ); + } } @override diff --git a/lib/utils/push_helper.dart b/lib/utils/push_helper.dart index 520db7de..3a322c2c 100644 --- a/lib/utils/push_helper.dart +++ b/lib/utils/push_helper.dart @@ -313,7 +313,7 @@ Future _setShortcut( await flutterShortcuts.pushShortcutItem( shortcut: ShortcutItem( id: event.room.id, - action: l10n.openChat, + action: AppConfig.inviteLinkPrefix + event.room.id, shortLabel: title, conversationShortcut: true, icon: avatarFile == null