Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardware Back not working when on First Scene #2283

Closed
tusharv-bidchat opened this issue Aug 24, 2017 · 6 comments
Closed

Hardware Back not working when on First Scene #2283

tusharv-bidchat opened this issue Aug 24, 2017 · 6 comments

Comments

@tusharv-bidchat
Copy link

Version

Tell us which versions you are using:

  • react-native-router-flux v4.0.0-beta.18
  • react-native v0.47.1

Expected behaviour

On Press on Hardware Back button on First Scene it should close the app.

Actual behaviour

App does not close.

Steps to reproduce

Here is my Router Component
const RouterComponent = () => {
return (



<Scene
key="login"
component={Login}
title={I18n.t('title_login')}
onEnter={isLoggedIn}
/>


<Scene
key="main"
component={Login}
title={I18n.t('title_login')}
/>




);
};

const isLoggedIn = () => {
const auth = AuthService.getAuthObject();
console.log(TAG, 'IsLoggedIn Check');
if (auth && auth.loggedIn) {
//Actions.home({ type: ActionConst.RESET });
}
};

@mikeduminy
Copy link

Same problem here

@aksonov
Copy link
Owner

aksonov commented Aug 25, 2017

Just pass prop backAndroidHandler to Router with own handler of back. Many users of RNRF didn't want to exit app for back button for some reason, so it works in such way.

@mikeduminy
Copy link

Ah okay, that seems to fix it. I used to use onBackAndroid.

@AntonDatsik
Copy link

AntonDatsik commented Aug 28, 2017

@aksonov
Help me please, as I understood, onBackAndroid works only on Android?
How to resolve this problem on IOS?

@aksonov
Copy link
Owner

aksonov commented Aug 28, 2017

Do you have hardware IOS back button??

@AntonDatsik
Copy link

Oh, sorry)
I use only Android.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants