DOT iOS Face Lite 9.0.0
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.
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
DotSdkConfigurationwithDotSdk.Configurationclass. - Update
librariesproperty ofDotSdk.Configurationclass.
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 methodstop(). - Remove the
FaceAutoCaptureViewControllerDelegate.faceAutoCaptureViewController(:processed:)callback and implementfaceAutoCaptureViewController(:uiStateUpdated:)instead.UiStateis an enum, and its caseUiState.Runningreplaces the data previously delivered via theonProcessed()callback. - Replace
FaceAutoCaptureViewControllerDelegate.faceAutoCaptureViewController(:captured:)callback withfaceAutoCaptureViewController(: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 methodstop().
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 methodstop().
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.
BgraRawImagehas been replaced by theImageclass.BgraRawImageFactoryhas been replaced byImageFactory.
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:)