Stuck on Android Splash Screen when app comes back from background

786 Views Asked by At

On Android device, app is stuck on splash screen when app comes from background. This happens when a notification is pressed when outside the app but was previously launched successfully. ALSO happens when app is exited by BackHandler.exitApp() function of RN.

Killing the app and restarting would fix the stuck on splash screen issue. But shouldn't be stuck in the first place.

I'm using RNN V2 with no 3rd party splash screen packages.

Does anyone have a fix for this? I'm thinking its related to Android's onResume function within the RNN-V2 wrapper.

1

There are 1 best solutions below

0
On

What you are missing, is setting up your navigator in onAppLaunched event.

Say, you're using Navigation.setRoot({...}) to set up in your app root. You need to register for onAppLaunched and call Navigation.setRoot({...}) or some custom bootstrap logic from within.

More info on said event can be found here.