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

'Login Cancelled' on Android appears under Catch error instead of !token. #208

Open
qwerqy opened this issue Sep 19, 2019 · 0 comments
Open

Comments

@qwerqy
Copy link

qwerqy commented Sep 19, 2019

Issue Description

When a user cancels the accountkit window, it's suppose to return token as null. This works with iOS in my project. However, in Android, it does not return token as null, instead it throws a Login Cancelled error.

Steps to Reproduce / Code Snippets

  1. Create normal login steps based on example in repo.
  2. Add a .catch under RNAccountKit.loginWithPhone().then(....).catch(e => console.log(e) function.
  3. Error shows up in console.log for Android if you cancel/press back from the accountkit window popup.

Expected Results

Error shows up in console.log for Android if you cancel/press back from the accountkit window popup. Shown in screenshot.

Screenshot 2019-09-19 at 12 11 08 PM

Additional Information

I usually would have a fallback login logic written when the token returns null. However, i have to write the code twice in both !token and `.catch(e => if (e.code === 'cancel') { ...}).

  • React Native Account Kit version: ^2.1.0
  • React Native version: 0.60.4
  • Platform(s) (iOS, Android, or both?): both
  • Platform Version(s): iOS 12.4 / Android 9.0
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

1 participant