IOS8 has added the localauthentication Framework for the authorization use of TouchID. Pro-Test, currently requires the user's device support fingerprint identification and has set the lock screen, and the actual test process feedback is relatively slow. Can not directly with the third-party account password binding, if you need to implement a third-party application of direct fingerprint identification login, need to store account information locally, fingerprint identification through the local read account information to log in. In short, the current fingerprint identification is with the device, device lock screen password binding. Test code:
Use touchid-(void) usingtouchid{lacontext *mycontext = [[[Lacontext alloc] init] autorelease]; Nserror *autherror = nil; NSString *mylocalizedreasonstring = @ "for fingerprint login"; if ([Mycontext canevaluatepolicy:lapolicydeviceownerauthenticationwithbiometrics Error:&autherror]) {[MyContex T Evaluatepolicy:lapolicydeviceownerauthenticationwithbiometrics localizedreason:mylocalizedreasonstring reply:^ (BOOL success, Nserror *error) {if (success) { User authenticated successfully, take appropriate action N SLog (@ "Success"); Uialertview *alertview = [[[Uialertview alloc] initwithtitle:@ "suceess" message:@ "has been identified by fingerprint! "Delegate:self cancelbuttontitle:nil otherbuttontitles:@" OK ", nil] autorelease]; [Alertview show]; } else { User did not authenticate successfully, look at error and take appropriate action NSLog (@ "fail with error:%@", error); Uialertview *alertview = [[[Uialertview alloc] initwithtitle:@ "Failed" Message:[error Localizeddescription] Delegate: Self cancelbuttontitle:nil otherbuttontitles:@ "OK", nil] autorelease]; [Alertview show]; } }]; } else {//Could not evaluate policy, look at Autherror and present a appropriate message to user NSLog (@ " Auth with error:%@ ", autherror); Uialertview *alertview = [[[Uialertview alloc] initwithtitle:@ "Failed" Message:[autherror Localizeddescription] Delegate:self cancelbuttontitle:nil otherbuttontitles:@ "OK", nil] autorelease]; [Alertview show]; }}
IOS8 using TouchID