React-Native Linking AddEventListener not working

This is because Linking have a specific method when the app start through a intent.

Try with this:

componentDidMount() {
  Linking.getInitialURL().then((ev) => {
    if (ev) {
      this._handleOpenURL(ev);
    }
  }).catch(err => {
      console.warn('An error occurred', err);
  });
  Linking.addEventListener('url', this._handleOpenURL);
}

Leave a Comment

tech