Class

UserAuthentication


Description

Allows the user to authenticate either with FaceID or TouchID.

Properties

Name

Type

Read-Only

Shared

SensorType

SensorTypes

Methods

Name

Parameters

Returns

Shared

Handle

Ptr

Request

reason As String, includePasscode As Boolean = False

Reset

Events

Name

Parameters

Returns

AuthenticationSucceeded

Error

error As RuntimeException

Enumerations

UserAuthentication.SensorTypes

SensorTypes

Specifies the type of sensor the device has for authentication.

Enum

Description

None

The device has no sensor for user authentication.

Fingerprint

The device has a fingerprint sensor.

Face

The device has a facial recognition sensor.

Property descriptions


UserAuthentication.SensorType

SensorType As SensorTypes

The type of sensor the device provides for authentication.

Method descriptions


UserAuthentication.Handle

Handle As Ptr

The handle is used to get a reference to the object for interfacing directly with the iOS API.


UserAuthentication.Request

Request(reason As String, includePasscode As Boolean = False)

Requests that the OS display its user interface that requires the user to authenticate as being the owner of the device.

The reason parameter is text displayed to the user explaining why they are required to authenticate. The includePasscode parameter indicates whether or not the user should be allowed to enter the device passcode should the primary means of authentication (typically face or fingerprint) fail.


UserAuthentication.Reset

Reset

Cancels the request for user authentication.

This will also allow you to request authentication a second time if necessary after the user successfully authenticates.

Event descriptions


UserAuthentication.AuthenticationSucceeded

AuthenticationSucceeded

The user successfully authenticated with the device.


UserAuthentication.Error

Error(error As RuntimeException)

An error occurred during authentication. The most common error would be that the user failed to authenticate. The error number and message in the RuntimeException are provided directly from the OS itself.

Notes

Warning

To use this class you must turn on the User Authentication switch by selecting iOS in the Build Settings of the Navigator and then clicking the Advanced tab in the Inspector.

When an application or a particular function of an application should be used only by the authorized user of the device, the UserAuthentication class can be used to ensure this. By requiring the user to authenticate, the device's operating system takes responsibility for this. Calling the Request method will begin the process. If it's successful, the AuthenticationSucceeded event will fire. If it fails, the Error event will fire. Keep in mind that this is an asynchronous process.

Compatibility

iOS projects on the iOS operating system.

See also

MobileControl parent class; RuntimeException class.