Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

sriscode/FaceId-Authentication-IphoneX

Open more actions menu

Repository files navigation

FaceId-Authentication-IphoneX

Face Id Authentication integration into the app

The code demonstrates how to integrate Face Id authentication integration into the app. Face Id is currently supported on iPhone X. This Code also works for touchId authentication.

Detailed explanation of the code is available at https://machinethinks.com/faceid-authentication-in-ios11-swift/.

Class MTBiometricAuthentication in this project is responsible for biometeric authentication and notify the success / fail status with Post Notification

How to use MTBiometricAuthentication class.

  1. Create an instance of MTBiometricAuthentication class
  2. Call authenticationWithBiometricID to initiate the authentication process
  3. Add notification observerers as below:

NotificationCenter.default.addObserver(self, selector: #selector(LoginVC.authenticationCompletionHandler(loginStatusNotification:)), name: .MTBiometricAuthenticationNotificationLoginStatus, object: nil)

  1. Typecast userInfo[MTBiometricAuthentication.status] to MTBiomericAuthenticationStatus instance (authStatus) that holds the response object. a) check if authStatus.success is true for successfull authentication b) if authStatus.success is false, check for authStatus.errorMessage for error message and authStatus.errorCode for LAError code. Currently all the possible error codes are mapped to error message in the response.

Output Screenshot from this project:

alt text

About

Face Id Authentication integration into the app

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.