tencent cloud

iOS APIs Overview Document

Download
フォーカスモード
フォントサイズ
最終更新日: 2026-08-12 11:08:32
AI翻訳

API Overview

The main API classes used in the Identity Verification (App SDK) for iOS are VerificationKit, VerificationConfig, and VerifiCommDef. Specific APIs in these classes are described as below.

VerificationKit

VerificationKit is a class of external APIs for the Identity Verification (App SDK). The main logic is completed with this class.
API
Feature Description
initWithViewController
Initialization APIs
clearInstance
Resource Release API
createMetaData
Obtain the MetaData string required for applying for a Token.
startVerifiWithConfig
Initiate the Identity Verification process.

initWithViewController

// Initialization method
- (void)initWithViewController:(UIViewController *)viewController;
Feature description:
The initialization API for Identity Verification (App SDK).
Input parameters:
Parameter Type
Parameter Name
Parameter Description
UIViewController
viewController
Calls the viewController object of the current SDK page

clearInstance

/// Clear SDK resources
+ (void)clearInstance;
Feature description:
SDK resource release API.


createMetaData

/// Obtain the MetaData string
+ (NSString *)createMetaData;
Feature description:
Obtain the MetaData field content required when applying for an SDK Token from Tencent Cloud. When calling the Tencent Cloud API to obtain a Token, pass the return value as the MetaData parameter.


startVerifiWithConfig

/// Start verification
- (void)startVerifiWithConfig:(VerificationConfig *)verifiConfig
withSuccCallback:(TXYVerifiKitProcessSucceedBlock)succCallback
withFialCallback:(TXYVerifiKitProcessFailedBlock)failCallback;
Feature description:
The method to initiate the Identity Verification process.
Input parameters:
Parameter Type
Parameter Name
Parameter Description
VerificationConfig
verifiConfig
Configuration information for the current process initialization
TXYVerifiKitProcessSucceedBlock
succCallback
Callback for successful SDK detection
TXYVerifiKitProcessFailedBlock
failCallback
Callback for SDK detection failure

TXYVerifiKitProcessSucceedBlock

/// Callback API for successful detection with the SDKKit
/// @param errorCode: Error code
/// @param resultInfo: Information returned by the callback
/// @param reserved: Reserved
typedef void (^TXYVerifiKitProcessSucceedBlock)(int errorCode,id _Nonnull resultInfo, id _Nullable reserved);

TXYVerifiKitProcessFailedBlock

/// Callback API for detection failure with the SDKKit
/// @param errorCode: Error code
/// @param errorMsg: Error message
/// @param reserved: Reserved
typedef void (^TXYVerifiKitProcessFailedBlock)(int errorCode, NSString *_Nonnull errorMsg, id _Nullable reserved);

VerificationConfig

VerificationConfig is the configuration entity class used during the SDK startup, which mainly covers the following attributes:
Type
Name
Meaning
Default Value
NSString
licPath
The path to the customer-applied user-authorized License file
Null
BOOL
openCheckRiskMode
Whether to enable device risk detection. When the input parameter SdkVersion in ApplySdkVerificationToken is set to ENHANCE or PLUS, it must be configured to be enabled (YES).
NO
NSString
riskLicense
Risk control authorization file path; required when openCheckRiskMode is set to YES.
Null
NSString
ekycToken
Token value obtained from the server-side, serving as the unique business credential for this identity verification.
Null
NSString
serverParamInfo
Server-side parameters for the Token mode obtained from Tencent Cloud, delivered together with the token.
Null
HYEkycLanguageType
languageType
Set the SDK language type.
HY_EKYC_EN
BOOL
isHiddenFlash
Whether to hide the button for turning on the flashlight in the OCR process
NO
NSString
userLanguageFileName
The target .lproj folder name in the custom language Bundle, such as ja.lproj. This takes effect only when languageType is set to HY_EKYC_CUSTOMIZE_LANGUAGE.
Null
BOOL
isShowPrivacyAgreementDialog
Whether the privacy policy pop-up is displayed before the verification process starts
YES
CGFloat
livenessAutoTimeout
Timeout duration for the liveness stage, in milliseconds
30000
BOOL
isOpenClipImage
Whether to enable the cropping page after the user selects an image from the gallery during the OCR stage.
NO
BOOL
isUseBackCameraOnFaceAuth
Whether to use the rear camera during the face detection phase
NO
BOOL
supportSystemAdjustsFont
Whether to honor font size adjustments in the system accessibility settings
NO
OcrCustomConfig
ocrCustomConfig
Custom UI configuration for the OCR phase, controlling the recognition frame color, prompt text style, and more.
Null
FaceCustomConfig
faceCustomConfig
Custom UI configuration for the identity verification phase, controlling the background color, prompt text style, circular frame color, and more.
Null
VerificationDelegate
delegate
SDK interface lifecycle event delegate, which can listen to the creation and destruction of OCR/identity verification interfaces
Null
NSString
userUIBundlePath
Absolute path of the user-defined UI resource bundle; defaults to nil when custom UI is not in use
Null
NSString
userLanguageBundlePath
Absolute path of the user-defined multilingual resource bundle; when nil, use huiyan_verification.bundle in mainBundle
Null
NSString
huiyanSDKBundlePath
Absolute path of the UI resource bundle for identity verification phase (HuiYanSDKUI.bundle); when nil, use HuiYanSDKUI.bundle in mainBundle
Null
NSString
verificationBundlePath
Absolute path of the core verification resource bundle for the identity verification phase (huiyan_verification.bundle); when nil, use huiyan_verification.bundle in mainBundle
Null
NSString
ocrSDKBundlePath
Absolute path of the OCR resource bundle (OcrSDK.bundle), used for dynamic download scenarios; when nil, use OcrSDK.bundle in mainBundle.
Null
NSString
ocrModelBundlePath
Absolute path of the OCR model resource bundle (OcrModel.bundle), used for dynamic download scenarios of multi-image OCR model files; when nil, use OcrModel.bundle in mainBundle.
Null
NSString
faceTrackerBundlePath
Absolute path of the identity verification resource bundle (face-tracker-v003.bundle), used for dynamic download scenarios; when nil, use face-tracker-v003.bundle in mainBundle
Null
BOOL
isShowTipsPage
Whether to display the preparation guide page for the identity verification phase (FaceVerifiPreViewController). When set to NO, the SDK skips the guide page and directly goes to liveness detection.
YES
BOOL
isShowResultPage
Whether to display the result page for the identity verification phase (FaceVerifiResultViewController). When set to NO, the SDK skips the result page and directly returns the outcome to the host app via callback.
YES
BOOL
isEntireHighlight
Whether to keep the phone screen brightness at maximum level throughout the liveness detection process. When set to YES, the screen remains at maximum brightness throughout the Face Recognition process.
NO



OcrCustomConfig

OcrCustomConfig refers to the custom UI configuration class for the document recognition and authenticity verification phase.
Type
Name
Meaning
Default Value
UIColor
rectNormalColor
Color of the detection frame in normal state
Null
UIColor
rectErrorColor
Color of the detection frame in error state
Null
UIColor
rectPassColor
Color of the detection frame in passed state
Null
UIColor
tipsNormalColor
Color of the prompt text in normal state
Null
UIColor
tipsErrorColor
Color of the prompt text in error state
Null
UIColor
tipsPassColor
Color of the prompt text in passed state
Null
UIFont
tipsFont
Font for the prompt text (when set, takes precedence over tipsFontSize)
Null
CGFloat
rectScaleX
Horizontal margin of the recognition frame as a percentage of screen width, with a value range of 0.0~0.15
0.03
CGFloat
rectTopMarginScale
Top margin of the recognition frame as a percentage of screen height (only effective in portrait mode; centered in landscape mode)
0.28
BOOL
isShowTips
Whether to display the prompt text
YES
NSString
tipsShowText
Custom prompt text content; falls back to the SDK default copy when set to nil
Null
BOOL
showBestImgConfirmDialog
Whether to display the best-frame confirmation dialog after automatic detection is completed.
NO

FaceCustomConfig

FaceCustomConfig is the custom UI configuration class for the identity verification stage.

Type
Name
Meaning
Default Value
UIColor
backgroundColor
Background color of the identity verification page
Null
UIColor
tipsTextColor
Color of the prompt text (normal state)
Null
UIColor
tipsTextErrorColor
Color of the prompt text (error state)
Null
UIFont
tipsTextFont
Font for the prompt text (including size)
Null
UIColor
faceCircleErrorColor
Color of the face circular frame (error state)
Null
UIColor
faceCircleCorrectColor
Color of the face circular frame (correct state)
Null
UIColor
countDownTextColor
Countdown text color
Null
UIColor
cancelButtonTextColor
Cancel button text color
Null
UIStatusBarStyle
faceStatusBarStyle
Status bar text color style on the face detection page. Defaults to follow the system (UIStatusBarStyleDefault)
UIStatusBarStyleDefault
BOOL
faceAuthAnimated
Whether to use transition animation when accessing the face detection page. When set to NO, the page opens without animation.
YES
BOOL
isHideFaceCountDown
Whether to hide the countdown on the face detection page. When set to YES, all countdown displays are hidden.
NO
BOOL
isShowErrorPopup
Whether to display a retry popup after liveness detection fails. When set to YES, the SDK displays a retry prompt popup after liveness detection fails; the host app can customize the popup via the onFaceErrorPopupWithView:title:message:retryBlock:cancelBlock: callback of VerificationDelegate.
NO

VerifiCommDef

HYEkycLanguageType

Multilingual configuration information for the SDK default interface.
Type
Meaning
HY_EKYC_DEFAULT = 0
Follow the system language version
HY_EKYC_ZH_HANS
Simplified Chinese
HY_EKYC_ZH_HANT
Traditional Chinese
HY_EKYC_EN
English
HY_EKYC_CUSTOMIZE_LANGUAGE
Custom language. The set custom language bundle (userLanguageBundleName) is used.



VerificationDelegate

The SDK interface lifecycle event protocol is used to monitor the creation and destruction events of the document recognition interface and identity verification interface:
@protocol VerificationDelegate <NSObject>
@optional
/// Callback when the OCR interface is created. authView is the root view displayed by the SDK.
- (void)ocrMainViewCreate:(UIView *)authView;
/// Callback when the OCR interface is removed.
- (void)ocrMainViewDestroy;
/// Callback when the face interface is created. authView is the root view displayed by the SDK.
- (void)faceMainViewCreate:(UIView *)authView;
/// Callback when the face interface is removed.
- (void)faceMainViewDestroy;

// Face phase dialog
- (BOOL)onFaceErrorPopupWithView:(UIView *)authView
title:(NSString *)title
message:(NSString *)message
nextBlock:(nullable void(^)(void))nextBlock
cancelBlock:(void(^)(void))cancelBlock;

// OCR phase dialogs
- (BOOL)onOcrBestFrameConfirmDialog:(NSDictionary *)info
imageView:(UIImageView *)imageView
parentView:(UIView *)parentView
confirmBlock:(void(^)(void))confirmBlock
cancelBlock:(void(^)(void))cancelBlock;

- (BOOL)onOcrNextSideDialog:(NSDictionary *)info
parentView:(UIView *)parentView
confirmBlock:(void(^)(void))confirmBlock;

- (BOOL)onOcrChangeModeDialog:(NSDictionary *)info
parentView:(UIView *)parentView
confirmBlock:(void(^)(void))confirmBlock
cancelBlock:(void(^)(void))cancelBlock;

- (BOOL)onOcrCloudErrorDialog:(NSDictionary *)info
parentView:(UIView *)parentView
retryBlock:(nullable void(^)(void))retryBlock
exitBlock:(void(^)(void))exitBlock;

- (BOOL)onOcrCameraPermissionDialog:(NSDictionary *)info
parentView:(UIView *)parentView
settingsBlock:(void(^)(void))settingsBlock
cancelBlock:(void(^)(void))cancelBlock;

// Loading
- (BOOL)onEkycShowLoading:(NSDictionary *)info parentView:(UIView *)parentView;
- (BOOL)onEkycHideLoading:(UIView *)parentView;

@end



Error codes and descriptions

Error Code
Error Code Definition
0
Successful
-1
Detection Failed
-2
Document Recognition Failure
-4
SDK Internal Error
216
On-device face detection failure
217
Camera Enable Failure
218
Do not switch applications during the identity verification process.
219
Camera Permission Exception
220
Video Cropping Failure
221
Light Data Format Error
222
Action Detection Timeout
223
Exceeds the Package Size Limit
227
Rear Camera Glare Error
272
Network Exception
300
Preparation Phase Timeout
301
Time-consuming Detection Timeout
302
Do not enable recording during the identity verification process.
303
Please do not take screenshots during the identity verification process.
304
Risk Control Module Initialization Failure
310
Initialization Parameter Exception
311
bundle configuration exception
313
First, call the initialization API.
314
SDK Authorization Failure
315
The user manually cancels.
322
Error Obtaining Remote Data
400
Risk Control Configuration Mismatch
101000
OCR Recognition Failure
100100
OCR Parameter Exception
100102
OCR Network Exception
100103
OCR Camera Permission Exception
300101
OCR Initialization Exception
300102
OCR Service Parsing Exception
300103
OCR Signature Failure
300104
OCR Camera Exception
300105
OCR Initialization Configuration Failure
300106
OCR Image Is Empty.
300107
OCR Authorization Failure
300108
OCR System Version Is Too Low.
300109
OCR Auto Mode Timeout
300110
OCR SDK Internal Error
300111
OCR Image Cropping Exception
400100
Alarm Code for Triggering Specified Interception
400101
The document type provided by the user does not match the specified document type.
400102
The document side provided by the user does not match the selected side.
400103
The document occupies too small a proportion in the photo uploaded by the user.
400104
The photo uploaded by the user contains multiple document images.
400105
OCR Recognition Failure
400106
Document Information Verification Failure
400107
Input Parameter Error.
400108
Internal Service Error
400109
Service Not Activated / Account Overdue Payment / Resource Bundle Exhausted / Billing Exception
400110
Rate Limiting Triggered
400111
File size too large or invalid.
400112
File Parsing Failure


ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック