EMSystemFaceAuthContainer

Objective-C


@interface EMSystemFaceAuthContainer : NSObject

Swift

class EMSystemFaceAuthContainer : NSObject

The biometric Face ID authentication container.

Warning

Do not subclass this interface.

Since

4.6
  • Designated constructor. Returns the EMSystemFaceAuthContainer object created using the EMSystemFaceAuthService

    Since

    4.6

    Declaration

    Objective-C

    + (instancetype)containerWithNativeFaceAuthService:
        (EMSystemFaceAuthService *)service;

    Swift

    convenience init!(nativeFaceAuthService service: EMSystemFaceAuthService!)

    Parameters

    service

    the instance of EMSystemFaceAuthService

    Return Value

    instance of this class

  • Authenticate user by face ID with PIN fallback feature. By using this API, the application could customize the action upon error cases. The completion handler will return an EMSystemFaceAuthInput object and face ID evaluatedPolicyDomainState upon success. The EMSystemFaceAuthInput object can be used to generate OTPs.

    Since

    4.6

    Declaration

    Objective-C

    - (void)authenticateUser:(id<EMAuthenticatable>)authenticatable
                 withMessage:(NSString *)localizedMessage
               fallbackTitle:(NSString *)fallbackTitle
           completionHandler:(void (^)(id<EMSystemFaceAuthInput>, NSData *,
                                       NSError *))completionHandler;

    Swift

    func authenticateUser(_ authenticatable: (any EMAuthenticatable)!, withMessage localizedMessage: String!, fallbackTitle: String!) async throws -> ((any EMSystemFaceAuthInput)?, Data?)

    Parameters

    authenticatable

    the target authenticatable item (e.g. CapToken)

    localizedMessage

    the message that will be displayed on face ID

    fallbackTitle

    the fallback title. If set to empty string, the button will be hidden.

    completionHandler

    completion handler to be called with the result once it’s completed. face ID evaluatedPolicyDomainState data will be returned upon success. [error code] will contain EM_STATUS_AUTHENTICATION_CANCELED_USER_FALLBACK if user tapped the fallback button.

  • Cancel biometric Face ID authentication prompt.

    Since

    5.0

    Declaration

    Objective-C

    - (void)cancelAuthentication;

    Swift

    func cancelAuthentication()