Regression: Resume the app with a deep link not navigating (#4428)

This commit is contained in:
Diego Mello 2022-08-11 16:40:31 -03:00
parent 049d24dec1
commit 306607b045
2 changed files with 31 additions and 13 deletions

View File

@ -122,6 +122,25 @@ describe('Deep linking', () => {
.toExist() .toExist()
.withTimeout(30000); .withTimeout(30000);
await tapBack(); await tapBack();
await waitFor(element(by.id('rooms-list-view')))
.toBeVisible()
.withTimeout(2000);
});
it('should resume from background and navigate to the room', async () => {
await device.sendToHome();
await device.launchApp({
permissions: { notifications: 'YES' },
newInstance: false,
url: getDeepLink(DEEPLINK_METHODS.ROOM, data.server, `path=group/${data.groups.private.name}`)
});
await waitFor(element(by.id(`room-view-title-${data.groups.private.name}`)))
.toExist()
.withTimeout(30000);
await tapBack();
await waitFor(element(by.id('rooms-list-view')))
.toBeVisible()
.withTimeout(2000);
}); });
}); });

View File

@ -119,24 +119,23 @@
[RNNotifications didFailToRegisterForRemoteNotificationsWithError:error]; [RNNotifications didFailToRegisterForRemoteNotificationsWithError:error];
} }
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url - (BOOL)application:(UIApplication *)application
sourceApplication:(NSString *)sourceApplication annotation:(id)annotation openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{ {
return [RCTLinkingManager application:application openURL:url return [RCTLinkingManager application:application openURL:url options:options];
sourceApplication:sourceApplication annotation:annotation]; }
- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity
restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler
{
return [RCTLinkingManager application:application
continueUserActivity:userActivity
restorationHandler:restorationHandler];
} }
- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window - (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{ {
return [Orientation getOrientation]; return [Orientation getOrientation];
} }
// Only if your app is using [Universal Links](https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html).
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity
restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler
{
return [RCTLinkingManager application:application
continueUserActivity:userActivity
restorationHandler:restorationHandler];
}
@end @end