An instance of LAContext can't determine biometryType until canEvaluatePolicy has been called
Chris-Corea opened this issue · 4 comments
Chris-Corea commented
It seems like your faceIDAvailable
function will always fail because you don't call canEvaluatePolicy
on the LAContext instance object before checking the biometry type.
Something like this should help:
public func faceIDAvailable() -> Bool {
if #available(iOS 11.0, *) {
let context = LAContext()
return (context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: nil) && LAContext().biometryType == .typeFaceID)
}
return false
}
Here's the apple doc describing the biometryType instance property: https://developer.apple.com/documentation/localauthentication/lacontext/2867583-biometrytype
rushisangani commented
Thanks for reporting an issue, this has been fixed now.
Please update your pod to latest version BiometricAuthentication (1.0.1)
hemangshah commented
Very quick support! Thanks @rushisangani 💯
fvvliet commented
Nice component, am going to use it now ;-)
rushisangani commented
Issue fixed in version 1.0.1