iOSLibTouchID - UBogun/Xojo-iosLib GitHub Wiki
Inherits from [n/a)
Memory leak check: untested.
Status: complete
This is an iOSLib wrapper class for AppleLAContext, the iOS native class for unlocking a device via fingerprint recognition.
A TouchID authentication view
General information
The simplest use is to drop an instance of iOSLibTouchID into your view in Xojo’s editor. Then you can use its events and methods as a view property.
Testing on Simulator
Apple‘s iOS Simulator is prepared for TouchID tests. You should:
- Use a simulator device that is TouchId capable.
- When running simulator, check "Touch ID Enrolled" under "Hardware"
- While you are running the authentication method, select "Matching" or "Non-Matching" from the "Simulate Finger Touch" entry just below the last in the "Hardware" menu.
Methods
Available As Boolean: Returns the availability of TouchID on the device.
Authenticate (Reason As Text): Starts the TouchID authentication process if the device is TouchID-capable. Reason will be displayed as additional information.
UnavailabilityError() As TouchIDError: Gives you the reason for unavailability of TouchId on the device.
TouchIDError
Value | Description |
---|---|
AuthenticationFailed | The fingerprint could not be recognized. |
UserCancel | User has cancelled the authentication. |
UserFallback | User wishes to unlock manually via Password. |
SystemCancel | Authentication was cancelled due to system’s decision, like low memory or incoming call. |
PasscodeNotSet | No password is set up. |
TouchIDNotAvailable | TouchId is not available on this device. |
TouchIDNotEnrolled | TouchID is available, but the user has not registered his fingerprint. |
NoError | Success. |
SimulatorNotSupported | You are running on a simulator device that does not support TouchID. |
UnavailabilityReason() As Text: Gives you the reason for unavailability of TouchId as localized text.
Events
Failed (ErrorNumber As iOSLibTouchID.TouchIDError, Description As Text): Fires when a TouchID evaluation failed, with information about error reasons.
Success(): Fires when the device was unlocked via TouchID.