#[repr(transparent)]pub struct LAPolicy(pub NSInteger);
LAContext
only.Expand description
Tuple Fields§
§0: NSInteger
Implementations§
Source§impl LAPolicy
impl LAPolicy
Sourcepub const DeviceOwnerAuthenticationWithBiometrics: Self
pub const DeviceOwnerAuthenticationWithBiometrics: Self
Device owner will be authenticated using a biometric method (Touch ID).
Biometric authentication is required. If Touch ID is not available, not enrolled or locked out, then the evaluation of this policy will fail with LAErrorBiometryNotAvailable, LAErrorBiometryNotEnrolled or LAErrorBiometryLockout.
Touch ID authentication dialog contains a cancel button with default title “Cancel” which can be customized using localizedCancelTitle property, and a fallback button with default title “Use Password…” which can be customized using localizedFallbackTitle property. Clicking either button causes evaluatePolicy call to fail, returning a distinct error code: LAErrorUserCancel or LAErrorUserFallback.
Biometric authentication will get locked after 5 unsuccessful attempts. After that, users have to unlock it by entering their account password. The password can be entered either at login window or in the preference sheets or even in application by the means of LAPolicyDeviceOwnerAuthentication. The system unlock is preferred user experience because we generaly don’t want users to enter their account password at application’s request.
Sourcepub const DeviceOwnerAuthentication: Self
pub const DeviceOwnerAuthentication: Self
Device owner will be authenticated by biometry or user password.
Touch ID or user password authentication is required. If Touch ID is not available, not enrolled or locked out, then the user is asked for password right away.
Touch ID authentication dialog behaves similarly as the one used by LAPolicyDeviceOwnerAuthenticationWithBiometrics. However, the “Use Password..” button does not end the authentication. Instead, it switches the authentication mechanism to user password.
Sourcepub const DeviceOwnerAuthenticationWithWatch: Self
👎Deprecated
pub const DeviceOwnerAuthenticationWithWatch: Self
Device owner will be authenticated by Watch.
Watch authentication is required. If no nearby paired watch device can be found, LAErrorWatchNotAvailable is returned.
Watch authentication dialog looks and behaves similarly to the biometric variant. Users can confirm authentication by double-clicking the side button on their watch.
Sourcepub const DeviceOwnerAuthenticationWithCompanion: Self
pub const DeviceOwnerAuthenticationWithCompanion: Self
Device owner will be authenticated by a companion device e.g. Watch, Mac, etc.
Companion authentication is required. If no nearby paired companion device can be found, LAErrorCompanionNotAvailable is returned.
Users should follow instructions on the companion device to authenticate.
Sourcepub const DeviceOwnerAuthenticationWithBiometricsOrWatch: Self
👎Deprecated
pub const DeviceOwnerAuthenticationWithBiometricsOrWatch: Self
Device owner will be authenticated by biometry or Watch.
Watch or biometric authentication is required. If no nearby paired watch device can be found, it behaves as LAPolicyDeviceOwnerAuthenticationWithBiometrics. Similarly, if biometry is unavailable it behaves as LAPolicyDeviceOwnerAuthenticationWithWatch.
Watch authentication dialog looks and behaves similarly to biometric variant. When both mechanisms are available, user is asked to use biometry and watch authentication will run in parallel.
Sourcepub const DeviceOwnerAuthenticationWithBiometricsOrCompanion: Self
pub const DeviceOwnerAuthenticationWithBiometricsOrCompanion: Self
Device owner will be authenticated by biometry or a companion device e.g. Watch, Mac, etc.
Companion or biometric authentication is required. If no nearby paired companion device can be found, it behaves as LAPolicyDeviceOwnerAuthenticationWithBiometrics. Similarly, if biometry is unavailable it behaves as LAPolicyDeviceOwnerAuthenticationWithCompanion.
When both mechanisms are available, user is asked to use biometry and companion authentication will run in parallel. Users should follow instructions on the companion device to authenticate.
Sourcepub const DeviceOwnerAuthenticationWithWristDetection: Self
pub const DeviceOwnerAuthenticationWithWristDetection: Self
Device owner will be authenticated by device passcode. The authentication will also succeed if the wrist detection is enabled, correct passcode was entered in the past and the watch has been on the wrist ever since.