1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-21 09:38:01 +02:00

Mobile: Fixes #9204: Handle callback url triggered app launch (#11280)

Co-authored-by: Tib Teng <661892+tiberiusteng@users.noreply.github.com>
Co-authored-by: Henry Heino <46334387+personalizedrefrigerator@users.noreply.github.com>
Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
This commit is contained in:
tiberiusteng 2024-10-31 16:19:13 +08:00 committed by GitHub
parent e32d6e93f3
commit 2fc9bd476b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -948,6 +948,21 @@ 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 && isCallbackUrl(url)) {
logger.info('received initial callback url: ', url);
this.callbackUrl = url;
}
const loadedSensorInfo = await sensorInfo();
this.setState({ sensorInfo: loadedSensorInfo });