Skip to content

Commit 2fc9bd4

Browse files
tiberiustengpersonalizedrefrigeratorlaurent22
authored
Mobile: Fixes #9204: Handle callback url triggered app launch (#11280)
Co-authored-by: Tib Teng <[email protected]> Co-authored-by: Henry Heino <[email protected]> Co-authored-by: Laurent Cozic <[email protected]>
1 parent e32d6e9 commit 2fc9bd4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

packages/app-mobile/root.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,21 @@ class AppComponent extends React.Component {
948948
throw error;
949949
}
950950

951+
// https://reactnative.dev/docs/linking#handling-deep-links
952+
//
953+
// The handler added with Linking.addEventListener() is only triggered when app is already open.
954+
//
955+
// When the app is not already open and the deep link triggered app launch,
956+
// the URL can be obtained with Linking.getInitialURL().
957+
//
958+
// We only save the URL here since we want to show the content only
959+
// after biometrics check is passed or known disabled.
960+
const url = await Linking.getInitialURL();
961+
if (url && isCallbackUrl(url)) {
962+
logger.info('received initial callback url: ', url);
963+
this.callbackUrl = url;
964+
}
965+
951966
const loadedSensorInfo = await sensorInfo();
952967
this.setState({ sensorInfo: loadedSensorInfo });
953968

0 commit comments

Comments
 (0)