Setting up Biometric(Face ID/ Touch ID) Login in Xamarin.iOS

Source : instabug.com

Here are list of steps to follow to set up Biometric Login (Face ID, Touch ID) for your Xamarin.iOS project.

  1. Before you begin, make sure you have a provisioning profile. If your organization has a provisioning profile you could use that, otherwise you can set up a free provisioning profile with this guide.
  2. Create a new or open existing Xamarin.IOS single view app. Then add BiometricAuthentication.cs class with following class and include ViewController.cs code snippet to your initial ViewController.cs. You can include required Authentication Success/Failure callback functions as shown in comments.

3. Make sure to add the Info.plist key NSFaceIDUsageDescription with any sensible string value.

4. If you are testing in simulator, make sure to Enroll Face ID/ Touch ID as shown below. The Application will load with either Face ID/Touch ID which is supported in device.

Enroll for Face ID
Test Success Face ID

Enjoy the Biometric Login :’)

References:

https://docs.microsoft.com/en-us/xamarin/ios/get-started/installation/device-provisioning

https://developer.xamarin.com/samples/monotouch/ios11/FaceIDSample

https://stackoverflow.com/a/47160418/6509848

Senior Software Engineer at 99x | Freelance developer | Interested in History and Philosophy

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store