首先,为什么每个应用程序都“启用”了Touch ID,而Face ID却没有。因此,如果您设置了Touch ID,则每个应用程序都可以使用它,但Face ID要求用户接受每个应用程序。
如何查找用户是否为我的应用程序启用了Face ID。
这是我用来找出授权类型的代码
let hasAuthenticationBiometrics = myContext.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: nil)
let hasAuthentication = myContext.canEvaluatePolicy(.deviceOwnerAuthentication, error: nil)
if #available(iOS 11.0, *) {
if hasAuthentication {
if hasAuthenticationBiometrics {
switch myContext.biometryType {
case .none: return .none
case .faceID: return .faceID // Find out if it is enabled
case .touchID: return .touchID
}
} else {
return .passcode
}
} else {
return .none
}
} else {
if hasAuthentication {
if hasAuthenticationBiometrics {
return .touchID
} else {
return .passcode
}
} else {
return .none
}
}
字符串
如果用户有脸ID,但禁用它为我的应用程序,我总是得到他“有”脸ID,即使我的应用程序是验证密码?
2条答案
按热度按时间nqwrtyyt1#
找到答案后,使用错误指针找出用户是否禁用了face id。
字符串
9avjhtql2#
试试下面的代码,使用下面的代码,你可以检查你的应用程序是否支持生物识别
字符串
}