Q:

RCTLinkingManager : Listening to application urls in iOS

Thanks to this great article here : http://blog.lum.pe/listening-to-application-urls-in-react-native/
I was able to make deep link and linkings to app work. whenever user clicks on any url starting with my custom url, app will open. but the problem is, if the is open and in background, i can access the URL (which opened the app, to get some values from it. it's like url://username:123)
but if the app is closed, and user clicks on link, app will be opened, but i cannot access the url anymore.
Is there any solutions for this?

A:

I just wrote about Universal Linking in iOS and Deep Linking Android.
https://github.com/parkerdan/React-Native-Rails-Universal-Linking
My guess is you are not getting the initial URL via Linking.getInitialURL() which handles the case of the app being closed.
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);

}

