I am trying to create a dynamic splash screen in the app, for that I have created a component screen called Splashscreen
and after a certain interval I am routing the user to the normal stack. The problem is when the user is navigating back I do not want the user to reach the splash screen before being able to exit the app.
This is my code so far
const NewsStack = StackNavigator({
. . .
});
export const Root = StackNavigator({
Splashscreen: {
screen: Splashscreen
},
Mainscreen: {
screen: NewsStack
}
}, {
mode: 'modal',
headerMode: 'none'
});
The NewsStack
is what contains the rest of the app. As of now the app works fine by opening the splashscreen and then navigating a different screen after a certain timeout but while navigating out of the app the user reaches the splashscreen. Is there any way other than listening for back button press? Does the back button method work in iOS as well?