Deep link when expo not running stuck at splash screen?

Please provide the following:

  1. SDK Version:40
  2. Platforms(Android/iOS/web/all):all
  3. Add the appropriate “Tag” based on what Expo library you have a question on.

In short, I’m using https link to deep link into my app that’s running in expo, basically a share link.
When using link to activate expo app it will start downloading javascript bundle from my local metro server.
The problem is that expo app will eventually get stuck on the splash screen and it will just stay like that.
When the expo is already running deep link works like a charm, no problems whatsoever.

I get the same behaviour in expo on Android, Android simulator and older Iphone device.

import 'react-native-gesture-handler';
import { NavigationContainer } from '@react-navigation/native';
import * as Linking from 'expo-linking';
import React from 'react';
import { Text } from 'react-native';

import MainStackNavigation from './navigations/MainStackNavigations';

const prefix = Linking.makeUrl('/');

const linking = {
  prefixes: [prefix],
  config: {
    screens: {
      TestShareScreen: 'share',
    },
  },
};

export default function App() {
  return (
    <NavigationContainer linking={linking} fallback={<Text>Loading...</Text>}>
      <MainStackNavigation />
    </NavigationContainer>
  );
}
import { createStackNavigator } from '@react-navigation/stack';
import React from 'react';
import PostLandingScreen from '../screens/PostLandingScreen';
import TestShareScreen from '../screens/TestShareScreen';

const MainStack = createStackNavigator();

function MainStackNavigation() {
  return (
    <MainStack.Navigator screenOptions={{ headerBackTitleVisible: false }}>
      <MainStack.Screen
        options={{ headerShown: false }}
        name={'PostLandingScreen'}
        component={PostLandingScreen}
      />
      <MainStack.Screen
        name='TestShareScreen'
        component={TestShareScreen}
        options={{
          headerTransparent: true,
          headerTitle: null,
          headerTintColor: 'white',
        }}
      />
    </MainStack.Navigator>
  );
}

export default MainStackNavigation;

Ok, expo IOS work propery.Share links opens the app if it wasn’t opened previously and it works like it’s supposed to work.

Problem is only on expo on Android device and emulator, only way for app not to get stuck on splash screen after openining deep link is to clear data/cache from Expo app every time.

Again this issue is not present if the app inside expo is already running, deep link opens the screen that it’s supposed to open.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.