title: Deeplinking with a domain name
body: <p>I have the following code in my <code>App.js</code>:</p>
  <pre class="lang-js prettyprint-override"><code>import React, { useState, useRef, useEffect } from 'react';
  import { SafeAreaView, Text } from 'react-native';
  import { NavigationContainer, useLinking } from '@react-navigation/native';
  import { createStackNavigator } from '@react-navigation/stack';
  
  const Stack = createStackNavigator();
  const Screen1 = () =&gt; &lt;SafeAreaView&gt;&lt;Text&gt;Screen1&lt;/Text&gt;&lt;/SafeAreaView&gt;;
  const Screen2 = () =&gt; &lt;SafeAreaView&gt;&lt;Text&gt;Screen2&lt;/Text&gt;&lt;/SafeAreaView&gt;;
  
  export default function App() {
    const ref = useRef();
    const [isReady, setIsReady] = useState(false);
    const [initialState, setInitialState] = useState();
    const { getInitialState } = useLinking(ref, {
      prefixes: ['http://example.com', 'mychat://'],
      config: {
        screens: {
          Screen2: 'screen-2',
        },
      },
    });
  
    useEffect(() =&gt; {
      getInitialState().then((state) =&gt; {
        if (state !== undefined) setInitialState(state);
  
        setIsReady(true);
      });
    }, [getInitialState]);
  
    if (!isReady) return null;
  
    return (
      &lt;NavigationContainer ref={ref} initialState={initialState}&gt;
        &lt;Stack.Navigator&gt;
          &lt;Stack.Screen name='Screen1' component={Screen1} /&gt;
          &lt;Stack.Screen name='Screen2' component={Screen2} /&gt;
        &lt;/Stack.Navigator&gt;
      &lt;/NavigationContainer&gt;
    );
  }
  </code></pre>
  <p>Most of them are copied from <a href="https://reactnavigation.org/docs/deep-linking/" rel="nofollow noreferrer">https://reactnavigation.org/docs/deep-linking/</a> and <a href="https://reactnavigation.org/docs/use-linking/" rel="nofollow noreferrer">https://reactnavigation.org/docs/use-linking/</a>.</p>
  <p>In the docs there is <code>prefixes: ['https://mychat.com', 'mychat://']</code>, I just changed <code>https://mychat.com</code> to <code>http://example.com</code>. But it doesn't seem to work.</p>
  <p>When I open the following links in Safari:</p>
  <ul>
  <li><code>mychat://</code> (works, gets redirected to app <strong>Screen1</strong>)</li>
  <li><code>mychat://screen-2</code> (works, gets redirected to app <strong>Screen2</strong>)</li>
  <li><code>http://example.com</code> (just opens the link in the browser, no popup to redirect to app)</li>
  </ul>
  <p>What change do I need to make to redirect the domain name to the mobile app? Am I missing something?</p>