Deep linking in IOS with react navigation does not route to the correct screen?

Viewed 192

I have set up deep linking in my project with react-navigation. It is successfully working in android. But in ios, it is opening the app successfully but does not route to the correct location.

this is how I code it with react-navigation.

import 'react-native-gesture-handler';
import * as React from 'react';
import {NavigationContainer} from '@react-navigation/native';
import {Linking} from 'react-native';
import AppStackNavigator from '_navigations/AppStackNavigator';
import I18n from 'i18n-js';

export default function App() {
  const linking = {
    prefixes: ['https://mydomain/meeting','myapp://meeting'],
    config: {
      screens: {
        login: 'login/:data',
      },
    },
  };

  return (
    <NavigationContainer linking={linking} >
      <AppStackNavigator />
    </NavigationContainer>
  );
}

As this one is not working then I tried it with getInitialState using use linking hook. Then the initial state was always undefined. I do not have any idea to fix this. I tried almost all the examples I was able to find to fix this issue. But I was unable to do so. If someone can help me to fix this it is really really grateful. Thank you.

react-navigation:"^5.2.16",
react:"16.11.0"
react-native:"0.62.2"
ios:14.2
xcode: 12
0 Answers
Related