I use SplashScreen.preventAutoHide(); in the constructor of my AppEntry Component. And hide it manually when everything is loaded with SplashScreen.hide();
This all seems to work fine in the simulator. However in the TestFlight App it does something weird. The first time I open the App it’s still just fine: SplashScreen shows and next the start screen shows. But when I force quit the App and open it again, the following happens:
The SplashScreen shows
Then flashes the start screen of the App
The SplashScreen shows (again)
The SplashScreen hides (again) and the start screen of the App shows (again)
How is this possible if I call SplashScreen.preventAutoHide(); and SplashScreen.hide(); only once?
I’m no expert, but is putting SplashScreen.preventAutoHide(); in the constructor the right place? The symptoms you described sounds like normal React behavior: whenever state changes, your app will “refresh” in the background, so this could be the reason why you see flickering.
According to the docs, place SplashScreen.preventAutoHide(); in componentDidMount(). There’s also an example if you’re using AppLoading.
If you look at the last example in the docs you see that SplashScreen.preventAutoHide(); is called in the constructor. And I think that’s the right place because you want to prevent hiding before the first render.
And I’am not exactly sure what you mean with “normal React behavior” but the issue occurs when force quitting the app and opening it again. So there shouldn’t be a “refresh” in the background, right?
Also it looks like it’s only “flashing” when you open the app, force quit the app and directly reopen the app again. If you wait long enough with reopening (10 minutes or so), you don’t see the flashy thing and the SplashScreen works just as normal. Maybe iOS is caching some things?