diff --git a/lib/config/app_config.dart b/lib/config/app_config.dart index 76cb183f..1e53ef31 100644 --- a/lib/config/app_config.dart +++ b/lib/config/app_config.dart @@ -43,6 +43,7 @@ abstract class AppConfig { static const bool hideTypingUsernames = false; static const bool hideAllStateEvents = false; static const String inviteLinkPrefix = 'https://matrix.to/#/'; + static const String deepLinkPrefix = 'im.fluffychat://chat/'; static const String schemePrefix = 'matrix:'; static const String pushNotificationsChannelId = 'fluffychat_push'; static const String pushNotificationsChannelName = 'FluffyChat push channel'; diff --git a/lib/utils/url_launcher.dart b/lib/utils/url_launcher.dart index 8b04a67c..05f81e94 100644 --- a/lib/utils/url_launcher.dart +++ b/lib/utils/url_launcher.dart @@ -20,7 +20,8 @@ class UrlLauncher { const UrlLauncher(this.context, this.url); void launchUrl() { - if (url.toLowerCase().startsWith(AppConfig.inviteLinkPrefix) || + if (url.toLowerCase().startsWith(AppConfig.deepLinkPrefix) || + url.toLowerCase().startsWith(AppConfig.inviteLinkPrefix) || {'#', '@', '!', '+', '\$'}.contains(url[0]) || url.toLowerCase().startsWith(AppConfig.schemePrefix)) { return openMatrixToUrl();