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

Fix android error from reusing a callback #81

Closed
wants to merge 2 commits into from

Conversation

jspaine
Copy link
Contributor

@jspaine jspaine commented Feb 3, 2018

The dialog closes on android after an incorrect attempt to authenticate, but the app keeps listening for fingerprints and breaks.

I think we just want to leave the dialog open if the error is "Authentication Failed" (fingerprint wasn't recognized). Then when the error is "Too many attempts. Try again later." the dialog closes.

This seems to work fine, but in FingerprintHandler.java the endAuth method also calls the onError callback with "Authentication Failed" if the cancellationSignal has already been cancelled for some reason. I guess that's unlikely, but maybe that error message should be changed to avoid issues?

fixes #67

@marcorm
Copy link

marcorm commented Feb 5, 2018

+1

@jspaine
Copy link
Contributor Author

jspaine commented Feb 5, 2018

This is probably a better fix, just don't handle the FingerprintManager.AuthenticationCallback.onAuthenticationFailed

@marcorm
Copy link

marcorm commented Feb 5, 2018

Thanks @jspaine ... I'll go with the second patch... Thanks a lot!!

@rodan-lewarx
Copy link
Contributor

@jspaine This solution works and thanks for the PR. But with this implementation the Fingerprint dialog on android gives no feedback when user scans invalid fingerprint and the dialog stays always open until you get five invalid fingerprints and the system shuts the fingerprint down. Do you have any idea how to handle this? On iOS the dialog flashes and updates itself with info that is was not successful.

@jspaine
Copy link
Contributor Author

jspaine commented Feb 14, 2018

Good point, my phone vibrates twice quickly if it's not recognized but some visual feedback would be nice too. How about a message and maybe changing the icon?

@rodan-lewarx
Copy link
Contributor

@jspaine Yeah, other apps usually flash icon indifferent colour or change icon and change text a little, explaining that the attempt failed.

@zibs zibs mentioned this pull request Feb 26, 2018
@zibs
Copy link
Collaborator

zibs commented Feb 26, 2018

I've opened #92 as a fix for this as well as another issue. I'm not going to be implementing any sort of UI changes, but would welcome a PR for changing that formatting/allowing other options.

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

Successfully merging this pull request may close these issues.

Android crashes when authentication fails at second time
4 participants