I need to identify if the user has any fingerprint register on their device. However, I got an error using this line
FingerprintManagerCompat fpm = (FingerprintManagerCompat)CrossCurrentActivity.Current.Activity.GetSystemService(Context.FingerprintService);
``` error ``
{System.InvalidCastException: Specified cast is not valid.
at app.Droid.lyA.FingerPrint.HasEnrolledFingerprints () [0x00002] in /../../../appmobile/../Droid/lyA/FingerPrint.cs:19 }
This is what I need to return.
Converting my comment to an answer-
It seems that there is an error with the casting you did at
It seems that whatever is being returned here cannot be cast to
FingerprintManagerCompat
.As mentioned in another answer, the correct way to use FingerprintManagerCompat is actually -
I would suggest changing to this and checking if it solves the issue.
The correct way of using FingerprintManagerCompat is actually something like this:
Good luck!
Revert in case of queries.