diff --git a/src/Android/Services/DeviceActionService.cs b/src/Android/Services/DeviceActionService.cs index 7bc2bdddf..bc770ed15 100644 --- a/src/Android/Services/DeviceActionService.cs +++ b/src/Android/Services/DeviceActionService.cs @@ -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) diff --git a/src/App/Abstractions/IDeviceActionService.cs b/src/App/Abstractions/IDeviceActionService.cs index 3359882e5..5d63af5d5 100644 --- a/src/App/Abstractions/IDeviceActionService.cs +++ b/src/App/Abstractions/IDeviceActionService.cs @@ -17,5 +17,6 @@ namespace Bit.App.Abstractions Task DisplayPromptAync(string title = null, string description = null, string text = null, string okButtonText = null, string cancelButtonText = null, bool numericKeyboard = false); void RateApp(); + bool SupportsFaceId(); } } \ No newline at end of file diff --git a/src/iOS/Services/DeviceActionService.cs b/src/iOS/Services/DeviceActionService.cs index efa7c052b..60f8db7f6 100644 --- a/src/iOS/Services/DeviceActionService.cs +++ b/src/iOS/Services/DeviceActionService.cs @@ -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)