1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-05 01:53:17 +00:00

faceid detection

This commit is contained in:
Kyle Spearrin
2019-05-17 09:45:07 -04:00
parent 4aa1209bc7
commit defb67c523
3 changed files with 21 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ using Bit.Core.Enums;
using Bit.iOS.Core.Views;
using CoreGraphics;
using Foundation;
using LocalAuthentication;
using MobileCoreServices;
using Photos;
using UIKit;
@@ -218,6 +219,20 @@ namespace Bit.iOS.Services
Device.OpenUri(new Uri(uri));
}
public bool SupportsFaceId()
{
if(SystemMajorVersion() < 11)
{
return false;
}
var context = new LAContext();
if(!context.CanEvaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics, out NSError e))
{
return false;
}
return context.BiometryType == LABiometryType.FaceId;
}
private void ImagePicker_FinishedPickingMedia(object sender, UIImagePickerMediaPickedEventArgs e)
{
if(sender is UIImagePickerController picker)