From 1d8fce65b7dea5dd992e04637789da21bc0b6ae3 Mon Sep 17 00:00:00 2001 From: Tib Teng <661892+tiberiusteng@users.noreply.github.com> Date: Thu, 31 Oct 2024 14:42:44 +0900 Subject: [PATCH] add comment for getInitialURL --- packages/app-mobile/root.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/app-mobile/root.tsx b/packages/app-mobile/root.tsx index 3c1ea9c53ca..a7de655bd07 100644 --- a/packages/app-mobile/root.tsx +++ b/packages/app-mobile/root.tsx @@ -948,8 +948,17 @@ class AppComponent extends React.Component { throw error; } + // https://reactnative.dev/docs/linking#handling-deep-links + // + // The handler added with Linking.addEventListener() is only triggered when app is already open. + // + // When the app is not already open and the deep link triggered app launch, + // the URL can be obtained with Linking.getInitialURL(). + // + // We only save the URL here since we want to show the content only + // after biometrics check is passed or known disabled. const url = await Linking.getInitialURL(); - if (url !== null && isCallbackUrl(url)) { + if (url && isCallbackUrl(url)) { logger.info('received initial callback url: ', url); this.callbackUrl = url; }