xamarin-fingerprint
xamarin-fingerprint copied to clipboard
Calling AuthenticateAsync on OnAppearing method doesn't wait for the fingerprint popup to appear
Steps to reproduce
-
Try to setup Fingerprint auth on OnAppearing method of a page.
-
Debug to see that it doesn't give the fingerprint popup on AuthenticateAsync method and returns false without awaiting
Note: I have used async on OnAppearing method, still it doesn't wait at AuthnticateAsync
Expected behavior
It should await on AuthenticateAsync and wait for user input and then proceed
Actual behavior
It doesn't wait on AuthenticateAsync and shows popup after the whole flow is over
Crashlog
No crash
Configuration
Version of the Plugin: 2.1.1
Platform: Android 9.0
Device: ASUS Zenfone max pro M2
Hi @raviteja-sriram,
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.
I have the same issue. The ErrorMessage of AuthenticateAsync result says "FragmentManager is already executing transactions"
FYI ; it worked well for me(Android 9.0/Android 10) maybe you haven't registered a fingerprint on the device (Settings->Security-> ... ) if this is the case nothing is displayed.
I am testing the app on my device(not an emulator) and fingerprints are registered. And the same scenario works when I open fingerprint popup on a button click but not on OnAppearing method of a page.
Can you upload code snippet of your page, maybe I am missing something in my code.
I am testing the app on my device(not an emulator) and fingerprints are registered. And the same scenario works when I open fingerprint popup on a button click but not on OnAppearing method of a page.
same here. It works fine after button click but not OnAppearing of a page.
Not sure if it's the same issue, but I was experiencing something very similar. I solved it by calling the AuthenticateAsync method within a Device.BeginInvokeOnMainThread block.
After inspecting the ErrorMessage property on the authentication result, it said something related to needing to be called from the main thread.
Not sure if it's the same issue, but I was experiencing something very similar. I solved it by calling the AuthenticateAsync method within a Device.BeginInvokeOnMainThread block.
After inspecting the ErrorMessage property on the authentication result, it said something related to needing to be called from the main thread.
Can you post the code snippet here for reference. Thanks in advance.
I am having a similar issue on iOS when receiving a push notification, where the user pushes accept button. The app is supposed to start and require authentication for the accept to respond back. Unfortunately, AuthenticateAsync() does not prompt for authentication. It just returns back false, causing a decline to be sent back to the server.
When I have more time, I will download the source and trace the issue.
I have same issue as @cbaumgartner. After call of AuthenticateByFingerPrintAsync in OnPageAppearing Dialog for fingerprint is shown but not awaited. I get False in FingerAuthenticationResult and error message "FragmentManager is already executing transactions". I have latest version 2.1.2 of plugin. Tested on Sony Xperia XZ1 (Android 9), HUAWEI ANE-LX1 (Android 8)
I can confirm that using this plugin like that:
var result = await Device.InvokeOnMainThreadAsync(() => CrossFingerprint.Current.AuthenticateAsync(new("","")))
solves the issue :)