Skip to content

Commit

Permalink
add comment for getInitialURL
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberiusteng committed Oct 31, 2024
1 parent a5bc843 commit 1d8fce6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/app-mobile/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 1d8fce6

Please sign in to comment.