A sample iOS app to demonstrate logins using biometrics (Face ID/Touch ID) available.
Face ID | Touch ID |
- Written in CleanSwift architecture
- A login page to fallback from biometrics authentication failure
- A biometrics page to authenticate using biometrics
- A dashboard page providing the capability to enable/disable biometrics login
- A
BiometricsWorker.swift
that does all the work to authenticate using Face ID/Touch ID
- Handles the 3 common use-cases in biometrics authentication:
- Success
- Biometrics authentication is successful
- Routes user to Dashboard
- Cancel
- User cancels biometrics authentication
- Routes user back to welcome screen
- Error
- Biometrics authentication unsuccessful due to any possible reason
- Routes user to Fallback page (Login)
- In
info.plist
file, add a description to the keyPrivacy - Face ID Usage Description
. This will be the localizedDescription for Face ID (as you may have already set for Touch ID) and it will suppress any 'app not updated to handle Face ID' messages. LocalAuthentication
framework is used to handle both Face ID and Touch ID.