xamarin-fingerprint
xamarin-fingerprint copied to clipboard
Fingerprint automatically cancels
Steps to reproduce
-
Request AuthenticateAsync()
-
Provide 5 times wrong fingerprint
-
Wait 30 seconds
-
Request AuthenticateAsync() once more
Expected behavior
Dialog is being shown and stayed till user provide fingerprint or cancel dialog.
Actual behavior
Dialog is being shown for short amount of time and then is closed automatically.
Crashlog
AuthenticationHandler.OnAuthenticationError() return code "5" and message "Fingerprint operation cancelled". I found that it can be because the sensor is occupied by a previous operation (https://stackoverflow.com/a/46277750).
It works fine when I cancel dialog:
await using (cancellationToken.Register(() => dialog.CancelAuthentication()))
{
dialog.Authenticate(info);
var result = await handler.GetTask();
if (!result.Authenticated)
{
// NOTE: release fingerprint
dialog.CancelAuthentication();
}
return result;
}
Configuration
Version of the Plugin: 2.1.1
Platform: Android 8.0.0
Device: Samsung S7 Edge
Hi @bohdanhrybach,
I'm the friendly issue checker. Thanks for using the issue template :star2: I appreciate it very much. I'm sure, the maintainers of this repository will answer, soon.
@smstuebe Maybe you can add me to contributors and I will create related PR?
I have same issue. Any update?
@Pelinalpp as I understand, no update :(
@bohdanhrybach you said "It works fine when I cancel dialog". I cancel CancellationTokenSource but it doesn't work. Do I understand wrong?
@Pelinalpp I assume that you just pass CancellationToken to AuthenticateAsync(token) and cancel it after get result, don't you? Sth like:
1) var tokenSource = new CancellationTokenSource();
2) var res = await AuthenticateAsync(tokenSource.Token);
3) tokenSource.Cancel();
But it will not work, changes is needed inside plugin. Because after we get result cancellation token disposes: https://github.com/smstuebe/xamarin-fingerprint/blob/0fc44bc84cf7a33d46f78fb34703c36d2e29a8ad/src/Plugin.Fingerprint/Platforms/Android/FingerprintImplementation.cs#L128 So cancelling CancellationTokenSource will not help.
Yes I did this thank you.
Could you update for this issue please? @smstuebe
@smstuebe The problem still exists. Could you please provide any updates about it?