Blank screen before splash screen appears on Android

#1

Hello! I have an app built using ExpoKit SDK 32, and I’m having trouble with the splash screen on Android. It appears, but only after a white screen is shown for a few seconds. I don’t know whats the issue, it didnt happen before I ejected.

I’m using react navigation with it. On my App.js component I do:

  render() {
    if (!this.state.appReady) {
      return <AppLoading autoHideSplash={false} />;
    }
    return (
      <Provider store={store}>
        <PersistGate persistor={persistor}>
          <StatusBar barStyle="light-content" translucent />
          <Container />
        </PersistGate>
      </Provider>
    );
  }

Then on my container, I just render my navigators. My initial screen is a Loading screen of a switch navigator. It just shows the same image of the splash screen while I decide which screen should I redirect to.

  async loadCorrectScreen() {
    Platform.OS === 'android' && SplashScreen.hide(); // no android fica mais fluido fazer a splash screen desaparecer antes
    try {
      const token = await AsyncStorage.getItem(BALADAPP_AUTH_TOKEN);
      if (token) {
        this.props.navigation.navigate('App');
      } else {
        this.props.navigation.navigate('Auth');
      }
    } catch (err) {
      // fazer nada
      // console.log(err);
      this.props.navigation.navigate('Auth');
    }
    Platform.OS === 'ios' && SplashScreen.hide(); // no ios fica mais fluido fazer a splash screen desaparecer depois
  }

  render() {
    return (
      <SafeAreaView style={styles.safeArea}>
        <ImageBackground
          source={require('../../assets/images/start.png')}
          resizeMode="cover"
          style={styles.image}
          fadeDuration={0}
          onLoadEnd={this.loadCorrectScreen}
        />
      </SafeAreaView>
    );
  }

And that’s it. The problem comes before all that, only on Android.
Also I’m sure the splash screen is showing up and not just the image on the load screen.

Also is there a better way to do all of this?

Thank you.