Migration Guides

Overview

From 4.0.0, we've introduced significant API improvements and feature enhancements. To make upgrading easier, here’s what you need to know:

Before & After Example

Before 4.0.0, we may using SDK like this:

(Note: Only partial configuration examples are shown here due to the SDK's extensive options)


From 4.0.0, we should using SDK like this:

(Note: Only partial configuration examples are shown here due to the SDK's extensive options)

Detail API List

APIs in the table below are now unavailable or deprecated since 4.0.0. You’ll need to update your code accordingly. Here we explain some document properties upfront to help you understand the table.

errorCode change detail

The following is a detailed list of changed or newly added error codes. Note that this list only includes modified/new errorCode entries. Codes not listed remain unchanged. For a complete reference of all error codes, please consult this documentation.

old errorCodenew errorCodeNotes
MUTI_FACEMULTIPLE_FACErenamed
PREPARE_TIMEOUTACTION_TIMEOUTIf you want to pinpoint which stage caused the timeout, check livenessVC.livenessStage. For example:
If the value is AAILivenessStageSilent, it means the timeout occurred during the silent stage.
If it’s AAILivenessStageAuth, the timeout happened during the Auth request stage, etc.
NO_RESPONSEAUTH_NETWORK{errorCode} or UPLOAD_IMAGE_DATA_NETWORK_ERROR{errorCode}AUTH_NETWORK_ERROR_{errorCode}: Indicates a network error occurred during the Auth request stage. For example, AUTH_NETWORK_ERROR_-1001 means the network request timed out during authorization.
UPLOAD_IMAGE_DATA_NETWORK_ERROR_{errorCode}: Indicates a network error occurred during the image data upload stage. For example, UPLOAD_IMAGE_DATA_NETWORK_ERROR_-1001 means the network request timed out while uploading image data.
 AUTH_GIVE_UP 
 UPLOAD_IMAGE_DATA_GIVE_UP 
 CAMERA_OPEN_FAILEDCamera open failed, please try again
 ERROR_NO_PARAMNo available model parameters matched
 MODEL_ERRORThis means that the model file is corrupted or load failed

AAILivenessViewController

Method/PropertyVersion RangestatusAlternativeNotes
detectPhonePortraitDirection>=1.2.3 <4.0.0unavailable  
detectionActions>=1.2.3 <4.0.0unavailablelivenessConfig.livenessType 
prepareTimeoutInterval>=1.2.9 <4.0.0unavailablelivenessConfig.silentTimeout 
actionTimeoutInterval>=1.2.8 <4.0.0unavailablelivenessConfig.actionTimeout 
timeoutDurationOf3DMode>=3.0.4 <4.0.0unavailablelivenessConfig.distantCloseTimeout 
cameraPermissionDeniedBlk>=1.2.3 <4.0.0unavailabledetectionFailureBlkBehavior change since 4.0.0:
When camera access is denied by the user, the SDK now triggers the detectionFailureBlk callback.
detectionReadyBlk>=1.2.3 <4.0.0unavailable  
frameDetectedBlk>=1.2.3 <4.0.0unavailable  
detectionTypeChangedBlk>=1.2.3 <4.0.0unavailablelivenessStageChangedBlkBehavior change since 4.0.0:
AAIDetectionType is unavailable and replaced by AAILivenessStage
detectionFailedBlk>=1.2.3 <4.0.0unavailabledetectionFailureBlk 
- (void)showImgWithType:(AAIDetectionType)detectionType>=1.2.3 <4.0.0unavailable- (void)updateImgWhenStageChange:(AAILivenessStage)fromLivenessStage to:(AAILivenessStage)toLivenessStageBehavior change since 4.0.0:
AAIDetectionType is unavailable and replaced by AAILivenessStage
- (void)didStopDetection>=3.4.0 <4.0.0unavailable- (void)detectionDidStopWithSuccess:(AAILivenessSuccessResult *)successResult
or
- (void)detectionDidStopWithFailure:(AAILivenessFailureResult *)failureResult
 

AAILivenessSDK

Method/PropertyVersion RangestatusAlternativeNotes
+ (void)configUserId:(NSString *)userId>=1.2.0 <4.0.0unavailablelivenessConfig.userId 
     
+ (void)configTicket:(NSString *)ticket>=1.1.0 <4.0.0unavailablelivenessConfig.ticket 
+ (void)configQueryId:(NSString *)queryId>=1.1.0 <4.0.0unavailablelivenessConfig.queryId 
     
+ (void)configResultPictureSize:(CGFloat)size>=1.1.2 <4.0.0unavailablelivenessConfig.resultPictureSize 
+ (void)configActionTimeoutSeconds:(NSTimeInterval)actionTimeout>=1.1.7 <4.0.0unavailablelivenessConfig.timeoutIntervalInSecForAction 
+ (void)configDetectOcclusion:(BOOL)detectOcc>=1.2.0 <4.0.0unavailablelivenessConfig.detectOcculsion 
+ (void)configModelBundlePath:(NSString *)modelBundlePath>=1.2.0 <4.0.0unavailablelivenessConfig.modelBundlePath 
     
+ (void)configVideo:(AAIVideoConfig * _Nullable)videoConfig>=2.0.0 <4.0.0unavailablelivenessConfig.videoConfig 
+ (nullable AAIVideoConfig *)videoConfig>=2.0.0 <4.0.0unavailablelivenessConfig.videoConfig 
+ (nullable AAIVideoRecordResult *)syncGetLatestVideoRecordResult>=2.0.0 <4.0.0unavailablelivenessSuccessResult.syncGetVideoRecordResult
or
livenessFailureResult.syncGetVideoRecordResult
 
     
+ (AAIAdditionalConfig *)additionalConfig>=2.0.0 <4.0.0unavailablelivenessViewController.livenessConfig 

AAILivenessResult

AAILivenessResult has been renamed to AAILivenessSuccessResult.

Method/PropertyVersion RangestatusAlternativeNotes
highestQualityOriginSquareImage>=1.0.0 <4.0.0unavailable Removed
- (NSArray<AAILivenessImageData *> *)imageDataSequenceList>=1.3.5 <2.0.0, >=3.0.7 < 4.0.0unavailableAAILivenessSuccessResult.auditImageDataList 

AAILivenessFailedResult

AAILivenessFailedResult has been renamed to AAILivenessFailureResult, and it has been moved from AAILivenessUI module to AAILivenessSDK module.


AAIAdditionalConfig

AAIAdditionalConfig has been renamed to AAILivenessConfig.

Method/PropertyVersion RangestatusAlternativeNotes
roundBorderColor>=2.0.0 <4.0.0unavailablelivenessConfig.normalAvatarBorderColor 
ellipseLineColor>=2.0.0 <4.0.0unavailablelivenessConfig.innerEllipseDashedLineColor 
ellipseBorderCol3D>=3.0.0 <4.0.0unavailablelivenessConfig.highlightAvatarBorderColor 
normalEllipseBorderCol3D>=3.3.0 <4.0.0unavailablelivenessConfig.normalAvatarBorderColor 
innerEllipseLineCol3D>=3.0.0 <4.0.0unavailablelivenessConfig.innerAnimatedEllipseLineColor 
detectionLevel>=2.0.1 <4.0.0unavailable Removed
prepareTimeoutInterval>=2.0.4 <4.0.0unavailablelivenessConfig.silentTimeout 
operatingMode>=3.0.0 <4.0.0unavailable Removed
     
enableCollectAuditImages>=3.1.0 <4.0.0unavailablelivenessConfig.auditImageConfig.enableCollect 
auditImageCaptureInterval>=3.1.0 <4.0.0unavailablelivenessConfig.auditImageConfig.imageCaptureInterval 
auditImageMaxNumber>=3.1.0 <4.0.0unavailablelivenessConfig.auditImageConfig.imageMaxNumber 
auditImageWidth>=3.1.0 <4.0.0unavailablelivenessConfig.auditImageConfig.imageWidth 
auditImageQuality>=3.1.2 <4.0.0unavailablelivenessConfig.auditImageConfig.imageQuality 
relativeSecondsCaptureAfterCameraLaunched>=3.3.0 <4.0.0unavailablelivenessConfig.auditImageConfig.relativeSecondsCaptureAfterCameraLaunched 
     
pluginType>=3.4.0 <4.0.0unavailablelivenessConfig.pluginType 
signatureId>=3.6.0 <4.0.0unavailablelivenessConfig.signatureId 

AAILivenessWrapView

Method/PropertyVersion RangestatusAlternativeNotes
detectionActions>=1.0.0 <4.0.0unavailable Removed
- (void)checkCameraPermissionWithCompletionBlk:(void (^_Nullable)(BOOL authed))completionBlk>=1.0.0 <4.0.0unavailable Removed
- (void)startAuthWithCompletionBlk:(void (^_Nullable)(NSError * _Nullable error))completionBlk>=1.2.3 <4.0.0unavailable- (void)startRunningWithConfig:(AAILivenessConfig *)livenessConfig 
- (void)stopRunningWithReason:(NSString *)reason>=2.0.7 <4.0.0unavailablestopRunning 

AAILivenessWrapDelegate

Method/PropertyVersion RangestatusAlternativeNotes
- (void)onOpenCameraFailed:(NSError * _Nonnull)error>=3.0.5 <4.0.0unavailable- (void)onFinalDetectionFailure:(AAILivenessFailureResult * _Nonnull)failureResult 
- (void)onDetectionFailed:(AAIDetectionResult)detectionResult forDetectionType:(AAIDetectionType)detectionType>=1.0.0 <4.0.0unavailable- (void)onFinalDetectionFailure:(AAILivenessFailureResult * _Nonnull)failureResult 
- (void)onFrameDetected:(AAIDetectionResult)result status:(AAIActionStatus)status forDetectionType:(AAIDetectionType)detectionType>=1.0.0 <4.0.0unavailable Removed
- (void)onDetectionReady:(AAIDetectionType)detectionType>=1.0.0 <4.0.0unavailable Removed
- (void)onDetectionTypeChanged:(AAIDetectionType)toDetectionType>=1.0.0 <4.0.0unavailable- (void)onLivenessStageChanged:(AAILivenessStage)newLivenessStage 
- (void)onDetectionRemainingTime:(NSTimeInterval)remainingTime forDetectionType:(AAIDetectionType)detectionType>=1.0.0 <4.0.0unavailable- (void)onDetectionRemainingTimeChanged:(NSInteger)remainingTime forLivenessStage:(AAILivenessStage)livenessStage 
- (void)onDetectionSuccess>=1.0.0 <4.0.0unavailable- (void)onLivenessStageChanged:(AAILivenessStage)newLivenessStage 
- (void)onDetectionComplete:(AAILivenessResult * _Nonnull)resultInfo>=1.0.0 <4.0.0unavailable- (void)onFinalDetectionSuccess:(AAILivenessSuccessResult * _Nonnull)successResult