相关疑难解决方法(0)

用于深层链接后未清除linking.getInitialURL()

我已经有两个星期了这个问题。我使用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)

android ios react-native deeplink

1
推荐指数
1
解决办法
1061
查看次数

标签 统计

android ×1

deeplink ×1

ios ×1

react-native ×1