我已经有两个星期了这个问题。我使用Wix的导航在应用程序中导航。我按照本教程实施了Deeplink / Universal链接。
我有一个称为的基类BaseScreen,其中像教程中一样保留所有的Deeplink处理程序。这BaseScreen会看起来像这样:
componentDidMount(){
// this handles the case where the app is closed and is launched via Universal Linking.
Linking.getInitialURL()
.then((url) => {
if (url) {
// Alert.alert('GET INIT URL','initial url ' + url)
this.resetStackToProperRoute(url)
}
})
.catch((e) => {})
// This listener handles the case where the app is woken up from the Universal or Deep Linking
Linking.addEventListener('url', this.appWokeUp);
}
componentWillUnmount(){
// Remove the listener
Linking.removeEventListener('url', this.appWokeUp);
}
appWokeUp …Run Code Online (Sandbox Code Playgroud)