Hi there,
I just installed your demo app on Android and it seems it uses
"react-native-router-flux": "^4.0.4",
and when I stay on first screen and hit back button then nothing happens (I am not able to quit the app). is it exactly how it suppose to work?
It is not good and should be fixed for sure. Unfortunately I don’t have enough time to work on it, PR is welcome!
6 нояб. 2018 г., в 10:15, Roman notifications@github.com написал(а):
Hi there,
I just installed your demo app https://github.com/aksonov/react-native-router-flux/tree/master/examples/react-native and it seems it uses
"react-native-router-flux": "^4.0.4",
and when I stay on first screen and hit back button then nothing happens (I am not able to quit the app). is it exactly how it suppose to work?—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub https://github.com/aksonov/react-native-router-flux/issues/3347, or mute the thread https://github.com/notifications/unsubscribe-auth/ABQpcSuXCEEwRooX8wK4r1CWDX_GWjy4ks5usdHZgaJpZM4YRAMi.
Duplicate of #3337
if anyone else has the same problem i have a temporary workaround for this problem. Add the following code to the class where you declare your router. That way you can have a way to exit app by using back button in Android
import {BackHandler} from 'react-native'
componentDidMount(){
BackHandler.addEventListener('hardwareBackPress', function() {
if (Actions.currentScene == 'your home screen name')
BackHandler.exitApp()
});
}
componentWillUnmount(){
BackHandler.removeEventListener('hardwareBackPress', function() {
if (Actions.currentScene == 'your home screen name')
BackHandler.exitApp()
})
}
and remember to change 'your home screen name' to the home screen key of your app.
Most helpful comment
if anyone else has the same problem i have a temporary workaround for this problem. Add the following code to the class where you declare your router. That way you can have a way to exit app by using back button in Android
and remember to change 'your home screen name' to the home screen key of your app.