[SDK 35] SplashScreen flashes

Please provide the following:

  1. SDK Version: 35
  2. Platforms(Android/iOS/web/all): iOS TestFlight

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?

If you look at the last example in the docs

My bad. It could be something else.

So there shouldn’t be a “refresh” in the background, right?

Yea, sounds weird. This is out of my league.

It could be a glitch? You could try asking on GitHub.

Some other thoughts when narrowing down the cause:

  • Does this happen on Android (both device and simulator)?
  • Does this happen on other iOS devices?

Edit: if you want, invite me to TestFlight and I’ll see if it’ll replicate on iOS 12 (iPhone 5S)

I created a GIF to show exactly what’s going wrong:

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?

Tested now with two iOS devices:

  • iPhone 6 (iOS 12): has described problem
  • iPhone X (iOS 13): no issues

So it seems like it only occurs on iOS 12…

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