Skip to main content

ios-face-lite-9-migration-guide


title: "DOT iOS Face Lite 9.0.0" description: "DOT iOS Face Lite migration guide version 8.x to 9.0. See important changes in this guide." lead: "This guide describes how to migrate DOT iOS Face Lite version 8.x to version 9.0. Only the most important changes are highlighted in this guide. For more details, see the iOS Samples." date: 2021-01-01T00:00:00+00:00 lastmod: 2021-01-01T00:00:00+00:00 keywords: "Digital Onboarding Face Lite detection verification migration guide for iOS" seoTitle: "Digital Onboarding Face Lite detection verification migration guide for iOS" draft: false images: [] menu: technical: parent: "api-migration" weight: 2209 search: false toc: true​

Migration Steps​

Compatibility with DIS​

When utilizing DIS for server-side evaluation, ensure compatibility between your DIS version and the corresponding SDK version. Refer to the DIS vs SDKs compatibility table for detailed compatibility information.

Deployment​

Changed minimal required iOS version to iOS 13.0. Changed minimal required Xcode version to Xcode 16.1.

SDK initialization​

The way DOT SDK libraries are configured has changed.

  • Replace DotSdkConfiguration with DotSdk.Configuration class.
  • Update libraries property of DotSdk.Configuration class.

Before​

Libraries were provided as a list of DotLibrary instances.

let dotSdkConfiguration = DotSdkConfiguration(
license: Data,
libraries: [DotFaceLiteLibrary()]
)

try DotSdk.shared.initialize(configuration: dotSdkConfiguration)

After​

Libraries are now configured via a single Libraries object, with explicit configuration for each DOT SDK library.

let dotSdkConfiguration = DotSdk.Configuration(
licenseBytes: license,
libraries: .init(
faceLite: DotFaceLiteLibraryConfiguration()
)
)

try DotSdk.shared.initialize(configuration: dotSdkConfiguration)

UI Face Auto Capture component​

The FaceAutoCaptureViewController class's API and configuration structure have changed. Existing configuration objects are not compatible with the new API and must be migrated to the new configuration model. Basic migration steps:

  • Update configuration.
  • Replace the method stopAsync(...) with the new method stop().
  • Remove the FaceAutoCaptureViewControllerDelegate.faceAutoCaptureViewController(:processed:) callback and implement faceAutoCaptureViewController(:uiStateUpdated:) instead. UiState is an enum, and its case UiState.Running replaces the data previously delivered via the onProcessed() callback.
  • Replace FaceAutoCaptureViewControllerDelegate.faceAutoCaptureViewController(:captured:) callback with faceAutoCaptureViewController(:finished:) callback.

Before​

//...
import DotFaceLiteCore
//...

let configuration = try FaceAutoCaptureViewController.Configuration(
sessionToken: sessionToken,
qualityAttributeThresholds: FaceAutoCaptureViewController.Configuration.QualityAttributeThresholdPresets.standard.build(),
minValidFramesInRowToStartCandidateSelection: 2,
candidateSelectionDurationMillis: 2000,
captureMode: .autoCapture,
isPlaceholderVisible: true,
isDetectionLayerVisible: false,
isTorchEnabled: false,
isVideoCaptureEnabled: false,
cameraFacing: .front,
cameraPreviewScaleType: .fill,
isCameraPreviewVisible: true
)

let viewController = FaceAutoCaptureViewController(configuration: configuration)

extension SampleViewController: FaceAutoCaptureViewControllerDelegate {
func faceAutoCaptureViewController(:processed:) {
//...
}

func faceAutoCaptureViewController(:captured:) {
//...
}
}

After​

//...
import DotFaceLiteCore
//...

let configuration = try FaceAutoCaptureViewController(
configuration: .init(
baseConfiguration: .init(
common: .init(sessionToken: ""),
camera: .init(
facing: .front,
previewScaleType: .fit,
isTorchEnabled: false,
isVideoCaptureEnabled: false,
isPreviewVisible: false
),
autoCapture: .init(minValidSamplesInRowToStartCandidateSelection: 2, candidateSelectionDurationMillis: 2000),
qualityAttributeThresholds: FaceAutoCaptureQualityAttributeThresholds.Presets.standard.build(),
captureMode: .autoCapture
),
isDetectionLayerVisible: false,
placeholder: .Visible(type: .circle)
)
)

let viewController = FaceAutoCaptureViewController(configuration: configuration)

extension SampleViewController: FaceAutoCaptureViewControllerDelegate {
func faceAutoCaptureViewController(:uiStateUpdated:) {
//...
}

func faceAutoCaptureViewController(:finished:) {
//...
}
}

UI Multi-Range Liveness component​

The MultiRangeLivenessViewController class's API and configuration structure have changed. Existing configuration objects are not compatible with the new API and must be migrated to the new configuration model. Basic migration steps:

  • Update configuration.
  • Replace the method stopAsync(...) with the new method stop().

Before​

//...
import DotFaceLiteCore
//...

let configuration = try MultiRangeLivenessViewController.Configuration(
sessionToken: sessionToken,
challengeSequence: [], // obtain challenge from DIS (Digital Identity Service)
isDetectionLayerVisible: true,
isTorchEnabled: false,
isVideoCaptureEnabled: false,
cameraFacing: .front,
cameraPreviewScaleType: .fit,
isCameraPreviewVisible: true
)

let viewController = MultiRangeLivenessViewController(configuration: configuration)

After​

//...
import DotFaceLiteCore
//...

let configuration = try MultiRangeLivenessViewController(
configuration: .init(
common: .init(sessionToken: ""),
camera: .init(
facing: .front,
previewScaleType: .fit,
isTorchEnabled: false,
isVideoCaptureEnabled: false,
isPreviewVisible: true
),
challengeSequence: [], // obtain challenge from DIS (Digital Identity Service)
isDetectionLayerVisible: false
)
)

let viewController = MultiRangeLivenessViewController(configuration: configuration)

UI MagnifEye Liveness component​

WARNING: This component is deprecated in favour of UI Multi-Range Liveness.

The MagnifEyeLivenessViewController class's API and configuration structure have changed. Existing configuration objects are not compatible with the new API and must be migrated to the new configuration model. Basic migration steps:

  • Update configuration.
  • Replace the method stopAsync(...) with the new method stop().

Before​

//...
import DotFaceLiteCore
//...

let configuration = try MagnifEyeLivenessViewController.Configuration(
sessionToken: sessionToken,
isDetectionLayerVisible: false,
isTorchEnabled: false,
isVideoCaptureEnabled: false,
cameraFacing: .front,
cameraPreviewScaleType: .fit,
isCameraPreviewVisible: false
)

let viewController = MagnifEyeLivenessViewController(configuration: configuration)

After​

//...
import DotFaceLiteCore
//...

let configuration = try MagnifEyeLivenessViewController(
configuration: .init(
common: .init(sessionToken: ""),
camera: .init(
facing: .front,
previewScaleType: .fit,
isTorchEnabled: false,
isVideoCaptureEnabled: false,
isPreviewVisible: true
),
isDetectionLayerVisible: false
)
)

let viewController = MagnifEyeLivenessViewController(configuration: configuration)

Image​

Several changes were applied to image-related functionality.

  • BgraRawImage has been replaced by the Image class.
  • BgraRawImageFactory has been replaced by ImageFactory.

Before​

var image: BgraRawImage = BgraRawImageFactory.create(cgImage:)
var image: BgraRawImage = BgraRawImageFactory.create(ciImage:ciContext:)

After​

var image: Image = ImageFactory.createBgraRawImage(cgImage:)
var image: Image = ImageFactory.createBgraRawImage(ciImage:ciContext:)