Screenshots for Android:
Screenshots for iOS:
Example for using Fingerprint authentication in Xamarin Android and Xamarin iOS
Using Rg.Plugin.Popup for Android custom popup screen
https://github.com/rotorgames/Rg.Plugins.Popup
This sample is assuming device already have an valid touchID.
Here is the setup.
Xamarin Android and Form project
- Install AiForm.Effect
https://github.com/muak/AiForms.Effects
Xamarin iOS project
- Install dannycabrera/Get-iOS-Model
https://github.com/dannycabrera/Get-iOS-Model
- Create interface for dependency service in PCL project. Please refer to the sample.
Android:
- Add permission in manifest.xml
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
- Create Class TouchIDAuthenticationAndroid.cs, CryptoObjectHelper.cs and AuthenticationCallBack.cs
iOS:
- Create Class TouchIDAuthenticationIOS.cs
To use it:
- Check the device is able to do the fingerprint authentication
bool canFingerprint = DependencyService.Get<Interface.TouchIDAuthentication>().IsFingerprintAuthenticationPossible();
- Authenticate
DependencyService.Get<Interface.TouchIDAuthentication>().Authenticate(actionIfSuccess, actionIfFail);