0
votes

I am trying to add splash screen to my react native android app but its giving me weird behaviour whenever I get a (remote/local) notification and on click to the notification component mounting the screen again that already mounted by showing splash again. I added splash by following this article of Spencer Carli.

I don't know this behaviour is because of the react native single activity android app or may be I am adding the splash activity above the main activity. I am using this react-native-splash-screen package .

I have also created a git repo for the Splash test for the above approach. Please Have a look on it.

I also tried splash without adding another activity using this rn-splash-screen package but that will give me white screen before splash or you can say on the cold start.

As I am not a native android developer but I want to make a splash like twitter, uber which show splash on the cold start. react-native-splash-screen package giving me ability to show splash on cold start but because of the abouve mentioned issue I cannot use it. Can anyone please guide me how to resolve this issue and achieve this type of splash screen.

1
@NileshRathod I have already mentioned this article of your comment.Shahzad

1 Answers

0
votes

Try this workaround.

You can add the splash screen inside your JS code. Use AppState to identify if your app is on a cold start or state change from background to foreground.

https://facebook.github.io/react-native/docs/appstate.html