Face


New library for face recognition. (Click to see more information)

Currently, we have new version of the SDK available. (Click to see more information)

9.7.33 🚀 Latest

The Face library allows you secure the user's identity through facial recognition. This library depends of your user case and is optional.

Contact to support for obtain the step for register in AKCore class.

Quick start


Add AKFaceSwift as a dependency in your Package Dependencies app.

https://github.com/Autentikar/face-spm.git

Dependencies


AKFaceSwift depends on AKCoreSwift so you need to add AKCoreSwift as a dependency in your Package Dependecies.

AKFaceSwift library depends on FaceTecSDK library current version is 9.7.33. This library is included in AKFaceSwift library from version 1.4.9. You don't need to add it as a dependency.

Set up


Initialize SDK

Before continuing, you can set up the SDK with the following code, we recommend that you do this in the AppDelegate class:

AppDelegate.swift
import AKCoreSwift
import AKFaceCaptureSwift

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    .....
    AKCore.register(for: AKFaceCapture.getProtocol(step: .yourStepProvidedBySupport))
    .....
    return true
}

This will register the AKFaceCapture in the AKCore class. This controller will be launched to capture the user's face, and it is mandatory to register this controller in the AKCore class.

Custom Theme


You can to call FaceTecCustomization() functions for setting colors of FaceTec. For more information visit page. And set the customization in AKFaceCapture.faceTecCustomization or AKFaceCapture.faceTecLowLightCustomization property.

For custom loading screen use AKFaceCaptureCustomization() function and call to AKFaceCapture.setCustomization(customization: custom). To custom view in FaceTec invoke the following code:

ViewController.swift
import AKFaceCaptureSwift

func autentikarCustomUI() {
    let faceCustomization = AKFaceCaptureCustomization()

    faceCustomization.backgroundColor = UIColor.your_background_color
    faceCustomization.showBackgroundImage = true | false
    faceCustomization.backgroundImage = UIImage(named: "your_background_image")
    faceCustomization.showLogo = true | false
    faceCustomization.logo =  UIImage(named: "your_logo")
    faceCustomization.activityViewColor =  UIColor.your_activity_view_color
    faceCustomization.textColor = UIColor.your_text_color
    faceCustomization.customFont = UIFont(name: "your_custom_font", size: 18)
    faceCustomization.bundleForFaceTecString = Bundle(identifier: "your_identifier")!
    faceCustomization.bundleForLocalizableString = Bundle(identifier: "your_identifier")!

    AKFaceCapture.setCustomization(customization: faceCustomization)

    // If you want to customize the FaceTec screen add this code
    let faceTecCustomization = FaceTecCustomization()
    let faceTecLowLightCustomization = FaceTecCustomization()
    .....
    
    AKFaceCapture.faceTecCustomization = faceTecCustomization
    AKFaceCapture.faceTecLowLightCustomization = faceTecLowLightCustomization
}

FaceTec Strings


If you want to FaceTec strings in your language, you can use the bundleForFaceTecString property. This property is a Bundle type and you must add a Localizable.strings file in your project. This strings properties are:

FaceTec.strings
"FaceTec_accessibility_cancel_button" = "Cancel";
"FaceTec_accessibility_torch_button" = "Toggle Light";

"FaceTec_action_ok" = "OK";
"FaceTec_action_im_ready" = "ESTOY LISTO";
"FaceTec_action_try_again" = "INTENTAR DE NUEVO";

"FaceTec_camera_permission_header" = "Habilitar Cámara";
"FaceTec_camera_permission_message_enroll" = "Por favor, Active\nSu Camara.";
"FaceTec_camera_permission_message_auth" = "Los Permisos De Tu Cámara Están Deshabilitados. Toque A Continuación, Para Editar Su Configuración.";
"FaceTec_camera_permission_enable_camera" = "HABILITAR CÁMARA";
"FaceTec_camera_permission_launch_settings" = "AJUSTES DE LANZAMIENTO";

"FaceTec_feedback_center_face" = "Centra Tu Cara";
"FaceTec_feedback_face_not_found" = "Enmarca Tu Rostro";
"FaceTec_feedback_face_not_looking_straight_ahead" = "Mira Hacia Adelante";
"FaceTec_feedback_face_not_upright" = "Mantenga La Cabeza Recta";
"FaceTec_feedback_hold_steady" = "Mantengase Estable";
"FaceTec_feedback_move_phone_away" = "Aléjese";
"FaceTec_feedback_move_phone_closer" = "Muévete Mas Cerca";
"FaceTec_feedback_move_phone_even_closer" = "Aún Más Cerca";
"FaceTec_feedback_move_phone_to_eye_level" = "Levante La Cámara Hasta El Nivel De Los Ojos";
"FaceTec_feedback_use_even_lighting" = "Rostro Más Claro De Manera Más Uniforme";

"FaceTec_instructions_header_ready_1" = "Prepárate Para";
"FaceTec_instructions_header_ready_2" = "Tu Video Selfie";
"FaceTec_instructions_message_ready_1" = "Enmarca Tu Rostro En El Óvalo,";
"FaceTec_instructions_message_ready_2" = "Presione Estoy Listo y muévase más cerca";

"FaceTec_presession_frame_your_face" = "Enmarca Tu Rostro En El Óvalo";
"FaceTec_presession_position_face_straight_in_oval" = "Mira hacia adelante";
"FaceTec_presession_hold_steady_3" = "Manténgase firme durante: 3";
"FaceTec_presession_hold_steady_2" = "Manténgase firme durante: 2";
"FaceTec_presession_hold_steady_1" = "Manténgase firme durante: 1";
"FaceTec_presession_eyes_straight_ahead" = "Mira hacia adelante";
"FaceTec_presession_remove_dark_glasses" = "Quitate las gafas oscuras";
"FaceTec_presession_neutral_expression" = "Expresión neutral, sin sonreír";
"FaceTec_presession_conditions_too_bright" = "Condiciones demasiado brillantes";
"FaceTec_presession_brighten_your_environment" = "Ilumina tu entorno";

"FaceTec_result_facescan_upload_message" = "Procesando Imagen";
"FaceTec_result_success_message" = "Exito";

"FaceTec_retry_header" = "Intentemos eso nuevamente";
"FaceTec_retry_subheader_message" = "Pero primero, eche un vistazo a su foto y corrija su entorno.";
"FaceTec_retry_instruction_message_1" = "Expresión neutra, sin sonreír";
"FaceTec_retry_instruction_message_2" = "Sin deslumbramiento o iluminación extrema";
"FaceTec_retry_instruction_message_3" = "Demasiado borrosa, limpia tu cámara";
"FaceTec_retry_your_image_label" = "Tu Selfie";
"FaceTec_retry_ideal_image_label" = "Pose ideal";

Properties

AKFaceCaptureCustomization class corresponds to the preloading screen. It has the following properties:

  • backgroundColor: Set the background color of the face capture interface.
  • showBackgroundImage: Show or hide the background image (default is false).
  • backgroundImage: Set the background image (if showBackgroundImage is false this image not show).
  • showLogo: Set the visibility of the logo in the face capture interface (default is true).
  • logo: Set the logo of the face capture interface (if showLogo is false this image not show).
  • activityViewColor: Set the color of the progress bar.
  • textColor: Set the text color of the face capture interface.
  • customFont: Set the font of the face capture interface only preloading. Deprecated
  • font: Set the font of the face capture interface only preloading. New
  • bundleForFaceTecString: Set the bundle for FaceTec strings.
  • bundleForLocalizableString: The bundle for localizable string.

Texts (Localizable)


For change the texts you have to add or modify the Localizable.strings file in your project, the keys are the following:

Localizable.strings
// Step Face Capture Activity
"StartingFaceCapture" = "Starting Face Capture";
"EndingFaceCapture" = "Ending Face Capture";
"ScreenSuccessMessage" = "Confirmed\nCapture";
Localizable.strings (Spanish)
// Step Face Capture Activity
"StartingFaceCapture" = "Iniciando Captura Facial";
"EndingFaceCapture" = "Finalizando Captura Facial";
"ScreenSuccessMessage" = "Captura\nConfirmada";