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

@ -286,6 +286,11 @@ namespace Bit.Droid.Services
}
}
public bool SupportsFaceId()
{
return false;
}
private bool DeleteDir(Java.IO.File dir)
{
if(dir != null && dir.IsDirectory)

View file

@ -17,5 +17,6 @@ namespace Bit.App.Abstractions
Task<string> DisplayPromptAync(string title = null, string description = null, string text = null,
string okButtonText = null, string cancelButtonText = null, bool numericKeyboard = false);
void RateApp();
bool SupportsFaceId();
}
}

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)