Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript RCTLinkingManager:在iOS中侦听应用程序URL_Javascript_Ios_Xcode_Reactjs_React Native - Fatal编程技术网

Javascript RCTLinkingManager:在iOS中侦听应用程序URL

Javascript RCTLinkingManager:在iOS中侦听应用程序URL,javascript,ios,xcode,reactjs,react-native,Javascript,Ios,Xcode,Reactjs,React Native,感谢这篇精彩的文章: 我能够使深度链接和应用程序的链接工作。每当用户点击任何以我的自定义url开头的url时,应用程序就会打开。但问题是,如果是在后台打开的,我可以访问URL(打开应用程序的URL),从中获取一些值url://username:123) 但如果应用程序关闭,用户点击链接,应用程序将被打开,但我无法再访问url 有什么解决方案吗?我刚刚写了关于iOS中的通用链接和深度链接Android 我猜你不是通过Linking.getInitialURL()获取初始URL的,它处理应用程序关

感谢这篇精彩的文章:

我能够使深度链接和应用程序的链接工作。每当用户点击任何以我的自定义url开头的url时,应用程序就会打开。但问题是,如果是在后台打开的,我可以访问URL(打开应用程序的URL),从中获取一些值url://username:123) 但如果应用程序关闭,用户点击链接,应用程序将被打开,但我无法再访问url


有什么解决方案吗?

我刚刚写了关于iOS中的通用链接和深度链接Android

我猜你不是通过
Linking.getInitialURL()
获取初始URL的,它处理应用程序关闭的情况

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);

}