Trulioo Compatible iOS Face capture SDK

Integration Guide - Trulioo Compatible iOS Facial capture

MiSnapFacialCaptureSampleApp - contains sources and assets of a sample app for developers

MiSnapFacialCaptureSampleApp.xcodeproj

SDKs

MiSnapFacialCapture - xcframework with both device and simulator architectures

Integration steps

MiSnap Facial Capture SDK

  • Add MiSnapFacialCapture folder (located in SDKs folder of this package) to your project in Xcode

  • Under the General settings of the target, in the Frameworks, Libraries, and Embedded Content section make sure Embed option for MiSnapFacialCapture is set to “Embed & Sign“

  • Under the Build Settings of the target, make sure a path where MiSnapFacialCapture.xcframework is located is added to Framework Search Path

Setup SDK Parameters

There are new SDK Parameters in this SDK. Refer to the API documentation for MiSnapFacialCaptureParameters.h located in the Docs/Code folder of the release package.

Note: Parameters have been carefully tuned for optimal performance in the SDK and on the backend. Modification of any parameters may adversely affect Facial Capture performance.

Create and Invoke MiSnap Facial Capture
Invoking MiSnap Facial Capture is a straight-forward process. At a high level, the steps are as follows:

  • Create an instance of the MiSnapFacialCaptureViewController with desired steps

  • Conform to its protocol (MiSnapFacialCaptureViewControllerDelegate)

Create an instance of the MiSnapFacialCaptureViewController

The following code snippet shows how to create the default parameters and present MiSnapFacialCaptureViewController in the client app:

let parameters = MiSnapFacialCaptureParameters.init()!
//parameters.countdownTime = 5
//parameters.mode = .manual
//parameters.timeout = 3
//parameters.roll = 800
//parameters.pitch = 1000
//parameters.yaw = 1000
 
// Uncomment line below to enable smile trigger
//parameters.selectOnSmile = true
         
// Uncomment line below to see face landmarks for debugging purposes
//parameters.highlightLandmarks = true
         
// Note, that "countdownStyle" is active only when "parameters.selectOnSmile" is "false" (default)
// See MiSnapFacialCaptureCountdownStyle enum in MiSnapFacialCaptureCountdownView.swift for all available countdown styles
// See MiSnapFacialCaptureReview enum in MiSnapFacialCaptureViewController.swift for all available review options
miSnapFacialCaptureVC = MiSnapFacialCaptureViewController.init(with: parameters, delegate: self, countdownStyle: .burndUp, review: .manualOnly)
 
guard let miSnapFacialCaptureVC = miSnapFacialCaptureVC else { fatalError("Could not initialize MiSnapFacialCaptureViewController") }
miSnapFacialCaptureVC.modalTransitionStyle = .crossDissolve
miSnapFacialCaptureVC.modalPresentationStyle = .fullScreen
 
presentVC(miSnapFacialCaptureVC)

Conform to MiSnapWorkflowViewController protocol (MiSnapFacialCaptureViewControllerDelegate)
The following code snippets show how to make host app’s view controller conform to the MiSnapFacialCaptureViewControllerDelegate

extension MainViewController: MiSnapFacialCaptureViewControllerDelegate {
    // MARK: MiSnapFacialCaptureViewControllerDelegate callbacks
     
    func miSnapFacialCaptureSuccess(_ results: MiSnapFacialCaptureResults) {
        self.results = results
        print("MIBI Data:\n\(results.mibiDataString ?? "")")
    }
     
    func miSnapFacialCaptureCancelled(_ results: MiSnapFacialCaptureResults) {
        // Handle cancel event
    }
}

Refer to MainViewController.swift of MiSnapFacialCaptureSampleApp project for more details.

Customizing the UX
The UX is written in Swift and is easily customizable. There is no Storyboard; all UI components are created and added dynamically in the source code.

Developers can modify the Swift sources and replace the image Resources to create the branding for client apps.

Accessibility in the UX
To customize labels for individual labels, buttons, screens, etc

In Xcode, search for “accessibility”. This will locate all the individual UX elements in the source code.

To customize the localized language strings used in voiceover

The MiSnapFacialCaptureLocalizable.strings files contain mappings for strings used for accessibility. These can be customized by changing the values on the right side of the “=”. Example:

"misnap_facial_capture_ux_success" = "Success!";

Simulator support and submitting to the AppStore

SDK is distributed in a form of xcframework therefore it supports both device and simulator architectures as well as submitting to the AppStore without running any pre- or post-build scripts.


Did this page help you?