在LAContext.h中
/@讨论此属性可以设置时间间隔(以秒为单位)。如果在此时间间隔内通过触摸ID成功解锁设备,则此上下文中的触摸ID身份验证将自动成功,并且将调用回复块,而不会提示用户输入触摸ID.The默认值为0,这意味着先前的TouchID身份验证无法通过reused.The最大支持间隔为5分钟,并且将该值设置为超过5分钟不会增加接受的间隔。
@property (nonatomic) NSTimeInterval touchIDAuthenticationAllowableReuseDuration NS_AVAILABLE_IOS(9_0);但当我使用此属性时,它不会产生任何影响
pragma标记-生命周期
-
(void)viewDidLoad {
[super viewDidLoad];
self.transitioningDelegate = self;
self.modalPresentationStyle = UIModalPresentationCustom;
self.context.touchIDAuthenticationAllowableReuseDuration = 5;
[self authenticationWithtouchID];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(15 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self authenticationWithtouchID];
});
}15秒后,可以使用上下文的TouchID静态身份验证
怎么了?
发布于 2016-02-18 15:25:06
时间间隔以秒为单位设置
您输入的值可能是非常短的持续时间。
尝试将间隔设置为大约300分钟为5分钟/ 240为4分钟
self.context.touchIDAuthenticationAllowableReuseDuration = 240;https://stackoverflow.com/questions/35474860
复制相似问题