mirror of
https://github.com/bitwarden/mobile.git
synced 2024-12-24 16:38:22 +01:00
faceid detection
This commit is contained in:
parent
4aa1209bc7
commit
defb67c523
@ -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)
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user