In our app, the user has to register to the device biometry in order to use it for authentication. The registration text and legal notes are according to the relevant biometry (register to touch ID or register to face ID) As far as I found, the biometry type is obtainable via the LAContext, but if the user denies usage of biometry, then the context returns biometryType=.none
Any ideas other that asking for the screen size and comparing to iphone X (bad bad code)?
static fileprivate var biometryType: DSLocalAuthenticationBiometryType {
let context = LAContext()
var error: NSError?
let _ = context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error)
if #available(iOS 11.0, *) {
return context.biometryType == .typeFaceID ? .typeFaceID : .none
}
else {
return .none
}
}
Thanks