IOS8 has added the localauthentication Framework for the authorization use of TouchID. For the moment, the user's device is required to support fingerprint identification and a lock screen is set up, and the feedback is slower during the actual test. Can not directly with the third-party account password binding, assuming the 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. Anyway. Fingerprint identification is now tied to device and device lock screen password.
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