#import "ViewController.h"
#import <localauthentication/localauthentication.h>
@interface Viewcontroller ()
@end
@implementation Viewcontroller
-(void) Touchesbegan: (nsset<uitouch *> *) touches withevent: (uievent *) Event {
/ /Fingerprint Identify Core Code // Create a local Authentication Context
lacontext *context = [[lacontext alloc] init];
Check whether the device supports fingerprint identification
Biometrics: biostatistics, this is fingerprint recognition.
if (! [Context Canevaluatepolicy:lapolicydeviceownerauthenticationwithbiometrics error :Nil]) {
NSLog (@ "Your device does not support fingerprint recognition!") );
return;
}
For fingerprint identification
Localizedreason: Why do you need fingerprint identification?
[Context evaluatepolicy:lapolicydeviceownerauthenticationwithbiometrics localizedreason:@ " Payment Please enter fingerprint " reply: ^ (BOOL success, nserror * _nullable error) {
if (success) {
NSLog (@ " successful fingerprint identification ");
}Else{
NSLog(@ "Fingerprint recognition failed:%@",error);
}
}];
}
@end
iOS fingerprint recognition