anitaa1990 / Biometric-Auth-Sample

Add Biometric Authentication to any Android app
247 stars 142 forks source link

[How to] Canceling fingerprint scanning ? #7

Closed mkorat1717 closed 5 years ago

mkorat1717 commented 5 years ago

Fingerprint scanner doesn't stop scanning after choose the CANCEL option. Step to reproduce 1) Open App and clicked on Login button. This will open up the bottom bar with fingerprint scanning option 2) Choose Cancel button. 3) Cancel callback invoked successfully and able to see the prompt too. 4) Fingerprint scanner still working in background. If user choose to put scan finger again, it prompt callback methods.

Looks like CancellationSignal object doesn't work with .authenticate method.

mirjalal commented 5 years ago

After searching for other fingerprint examples I found the solution of your problem in this example by @googlesamples. I think, @anitaa1990 just forgot to create an object instance of CancellationSignal class in this method and cancel it before firing callback method.

hassanmhd commented 5 years ago

@mkorat1717 You can check my pull request #9 which solves this problem.

mkorat1717 commented 5 years ago

Thank you guys for your contribution ! Looks #9 fixed the issue.