Closed dan12411 closed 3 years ago
Here some problem. Line 55 not sure about status, its may be . notDetermined
or allowed
. Maybe you have idea how detect it correctly?
Hi, @ivanvorobei I think .allowed
is better than .notDetermined
, because device is allowed to use biometric authentication already, rather than notDetermined. To do that we can solve the controller not dismiss issue. 🤔 Thanks 🙏
@dan12411 when user first see Face ID, he see allowed
state. Maybe it confused him.
@ivanvorobei The condition is isReady == true
, means the user is passed the bio auth, so .allowed
should not be confused, am I right?
let isReady = context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error)
case nil where isReady:
return .notDetermined
doc: https://developer.apple.com/documentation/localauthentication/lacontext/1514149-canevaluatepolicy
isReady
property indicate if user has FaceID. It not same as allowed or not allowed for permission.
If you change it as you suggest, then even at first startup the user will see that permission has already been granted, although this is not the case.
There is really no way to check the current status of the FaceID permission. It works like this - if this is the first authorization attempt, permission will be shown. If it is the second and subsequent attempts, permission will not be requested. We don't know which attempt it is and there is no way to get that information.
I can add maybe flag or something else for have specific process for FaceID permission.
Got it, If the changed you suggest can dismiss the controller automatically will be great,
Thanks for your kindly reply : )
My idea this - for FaceID always show .notDetermined
UI, but close controller with request even user not allow permission.
Should line 55 return .authorized? 🤔 Because I encounter the status stay
.notDetermined
and the controller would not dismiss automatically (which has setcontroller.dismissCondition = .allPermissionsDeterminated
)https://github.com/ivanvorobei/SPPermissions/blob/6618b3a84b8063c82652bee67ea47044b7bd46b0/Sources/SPPermissionsFaceID/SPFaceIDPermission.swift#L55