IOS SDK details: Apps use Touch ID authentication, iossdk

Source: Internet
Author: User

IOS SDK details: Apps use Touch ID authentication, iossdk

Original Blog, reprinted, please indicate the source
Blog.csdn.net/hello_hwc

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 does not obtain the specific fingerprint information.
  • 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

Supported Devices
  • IPhone 5S +
  • IPad Air 2 +
  • IPad Mini 3 +

How to Use
Framework used for Import

#import <LocalAuthentication/LocalAuthentication.h>

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-the user cancels the authentication (for example, click cancel)
  • LAErrorUserFallback-cancel a user (click "password)
  • LAErrorSystemCancel-system canceled
  • LAErrorPasscodeNotSet-no password set in the system
  • LAErrorTouchIDNotAvailable-the device does not support TouchID
  • LAErrorTouchIDNotEnrolled-Touch ID is not set (none for one fingerprint)

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.