diff --git a/Riot/Modules/Application/LegacyAppDelegate.m b/Riot/Modules/Application/LegacyAppDelegate.m index 06dfac203..a5fe2bd43 100644 --- a/Riot/Modules/Application/LegacyAppDelegate.m +++ b/Riot/Modules/Application/LegacyAppDelegate.m @@ -1312,8 +1312,17 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni // Sanity check if (!pathParams.count) { - MXLogDebug(@"[AppDelegate] Universal link: Error: No path parameters"); - return NO; + // Handle simple room links with aliases/identifiers as UniversalLink will not parse these. + NSString* absoluteUrl = [universalLink.url.absoluteString stringByRemovingPercentEncoding]; + if ([MXTools isMatrixRoomAlias:absoluteUrl] + || [MXTools isMatrixRoomIdentifier:absoluteUrl]) + { + pathParams = @[absoluteUrl]; + } + else { + MXLogDebug(@"[AppDelegate] Universal link: Error: No path parameters"); + return NO; + } } NSString *roomIdOrAlias; diff --git a/Riot/Utils/UniversalLink.m b/Riot/Utils/UniversalLink.m index 2f1a97936..edd73c7b8 100644 --- a/Riot/Utils/UniversalLink.m +++ b/Riot/Utils/UniversalLink.m @@ -16,7 +16,6 @@ #import "UniversalLink.h" #import "NSArray+Element.h" -#import "MXTools.h" @implementation UniversalLink @@ -52,13 +51,6 @@ // Remove the first empty path param string pathParams = [pathParams filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"length > 0"]]; - // Handle room links with aliases/identifiers - if ([MXTools isMatrixRoomAlias:[_url.absoluteString stringByRemovingPercentEncoding]] - || [MXTools isMatrixRoomIdentifier:[_url.absoluteString stringByRemovingPercentEncoding]]) - { - pathParams = @[_url.absoluteString]; - } - // URL decode each path param pathParams = [pathParams vc_map:^id _Nonnull(NSString * _Nonnull item) { return [item stringByRemovingPercentEncoding];