References
This page contains references for possible error codes, object structure, etc. Most of this can be obtained from clicking into code via Xcode, but it is also provided here as a reference.
SmartCapture Face Result
public final class FaceCameraResult: NSObject, NSSecureCoding {
public let encryptedBlob: Data
public let unencryptedBlob: Data
public let previewPhoto: UIImage
}
The encryptedBlob is what should get sent to the server, while the previewPhoto can be used for on-device preview. It is not recommended to use the previewPhoto for any secure use cases.
Errors
When an error occurs, unless otherwise specified it will be a FaceCameraError, which is a custom class that extends Error and wraps over IDCameraControllerBase.Error.
public enum FaceCameraError: Error {
case cameraPermissionDenied
case faceNotDetected
case manualCaptureNotAllowed
case initializationError
case photoCaptureError
case unknown(Error)
static func from(_ error: IDCameraControllerBase.Error) -> Self {
switch error {
case .cameraPermissionDenied:
return .cameraPermissionDenied
case .initializationError:
return .initializationError
case .faceDetectorError:
return .faceNotDetected
case .photoCaptureError:
return .photoCaptureError
case .platformNotAllowed, .error:
return .unknown(error)
@unknown default:
return .unknown(error)
}
}
}