我正在将TouchID集成到我的应用中。出于安全原因,我允许用户打开和关闭它。我希望它在用户添加新指纹时自动关闭。 据苹果,evaluatedPolicyDomainState
TouchID - 检测添加的新指纹 - evaluatePolicyDomainState何时更改?
This property returns a value only when the canEvaluatePolicy(:error:) method succeeds for a biometric policy or the evaluatePolicy(:localizedReason:reply:) method is called and a successful Touch ID authentication is performed. Otherwise, nil is returned.
The returned data is an opaque structure. It can be used to compare with other values returned by this property to determine whether the database of authorized fingerprints has been updated. However, the nature of the change cannot be determined from this data.
不过,我添加了新的指纹和evaluatedPolicyDomainState
保持不变。
关于如何确保evaluatedPolicyDomainState
得到更新或者是否有任何其他方式检查是否添加新指纹?
嗨克里斯蒂安,我们也有这个requiremnet在我们的app.Can你请告诉我应该分配给oldDomainState变量? – RXGangam
当您第一次请求用户设置touchID时,您将使用'context.evaluatePolicy'。如果成功,则获取当前策略并将其保存到oldDomainState。 –
我已使用kSecAccessControlTouchIDCurrentSet。现在它按预期工作。 – RXGangam