यह LAContext (स्थानीय प्रमाणीकरण ढांचे) जो एक सुरक्षा policy.It चेकों का मूल्यांकन करने के इस्तेमाल किया जा सकता का उपयोग कर, टच आईडी सेंसर का उपयोग कर, उस व्यक्ति को प्रमाणीकरण डिवाइस स्वामी है के द्वारा प्राप्त किया जा सकता है। भविष्य में अन्य सुरक्षा नीतियां हो सकती हैं। [? फ़िंगरप्रिंट संवेदक अन्य एप्लिकेशन के लिए उपलब्ध है]
-(void)handlerForFingerTouch{
LAContext *context = [[LAContext alloc] init];
NSError *error = nil;
if ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error]) {
[context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
localizedReason:@"Are you the device owner?"
reply:^(BOOL success, NSError *error) {
if (error) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
message:@"There was a problem verifying your identity."
delegate:nil
cancelButtonTitle:@"Ok"
otherButtonTitles:nil];
[alert show];
return;
}
if (success) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Success"
message:@"You are the device owner!"
delegate:nil
cancelButtonTitle:@"Ok"
otherButtonTitles:nil];
[alert show];
} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
message:@"You are not the device owner."
delegate:nil
cancelButtonTitle:@"Ok"
otherButtonTitles:nil];
[alert show];
}
}];
} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
message:@"Your device cannot authenticate using TouchID."
delegate:nil
cancelButtonTitle:@"Ok"
otherButtonTitles:nil];
[alert show];
}
}
@rckoenes सही पढ़ा यह (https के बारे में 'सेब देव केंद्र मंच discussion' है:
यहाँ उसी के लिए कोड का टुकड़ा है // devforums.apple.com/message/884859#884859) –