IOS SDK details-App use Touch ID Authentication

Source: Internet
Author: User

IOS SDK details-App use Touch ID Authentication

 

Since iOS 8.0, Apple has enabled the App to use Touch ID for authentication. Note the following points:

The App only proxies the authentication process to the iOS system and cannot obtain the fingerprint details. Do not try to compare the fingerprint information with other databases. It is still impossible on the day I wrote it. Used

Start verification

Verification Failed

IPhone 5S + iPad Air 2 + iPad Mini 3 +

How to Use
Framework used for Import

#import 
  

Initialize a LAContext

  LAContext * context = [[LAContext alloc] init];

Check whether the current device supports TouchID

NSError * error = nil;    if ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error]) {    ...}

If yes, perform Touch ID authentication.

[Context evaluatePolicy: LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason: @ To login in reply: ^ (BOOL success, NSError * error) {if (success) {// success} else {// failure}];

There are several Error types returned for failure.

LAErrorAuthenticationFailed-Fingerprint Authentication failed LAErrorUserCancel-user cancellation (for example, click cancel) LAErrorUserFallback-user cancellation (click Enter password) LAErrorSystemCancel-the system cancels LAErrorPasscodeNotSet-the system does not set the password LAErrorTouchIDNotAvailable-the device does not support TouchID LAErrorTouchIDNotEnrolled-Touch ID not set (one fingerprint does not exist)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.