Hello,
Welcome to our Microsoft Q&A platform!
Does anyone had implemented the below use cases either using Xamarin Android / Xamarin iOS or Xamarin Forms.
The app needs to identify if biometric sensors are available or not.
The app to allow the option to enroll biometrics (Fingerprint / FaceId for iOS) even if the device not have finger prints enrolled.
For Xamarin.android, AndroidX provide an Api to check it if biometric sensors are available or not. Or biometric if is enrolled.
Firstly, you need to install this nuget package.Xamarin.AndroidX.Biometric
Then Use following code to judge if is enrolled the biometrics. If not, open the setting's package(Please ignore the waring, because this is a new api for Google).
var biometricErrorNoneEnrolled = (int)AndroidX.Biometric.BiometricManager.BiometricErrorNoneEnrolled;
if (AndroidX.Biometric.BiometricManager.From(ApplicationContext).CanAuthenticate()== biometricErrorNoneEnrolled)
{
StartActivity(new Intent(Android.Provider.Settings.ActionSecuritySettings));
}
For iOS, You can check this document about Check the availability of biometric hardware.
https://learn.microsoft.com/en-us/xamarin/ios/platform/touch-id-face-id
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.