'React Native clear getInitialURL after use
I am using Linking to handle SSO for my app. But the problem is that if the app is redirected once, Linking.getInitialURL() is called every time, even when the app is not redirected from other app.
I am calling the function in my root container like this
async componentDidMount() {
this.isMounted = true;
Linking.addEventListener('url', this.onRedirection);
let initialURL = await Linking.getInitialURL();
if (initialURL) {
this.onRedirection({url: initialURL});
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
