tencent cloud

All product documents
APIs for iOS
Last updated: 2023-08-10 15:02:45
APIs for iOS
Last updated: 2023-08-10 15:02:45

API description

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.

1.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
Initializes the SDK.
clearInstance
Releases resources.
startVerifiWithConfig
Starts the identity verification process.

1.1. initWithViewController

// Initialization method
- (void)initWithViewController:(UIViewController *)viewController;
Feature description:
This API is used to initialize the Identity Verification SDK.
Input parameters:
Type
Parameter
Description
UIViewController
viewController
Calls the viewController object of the current SDK page

1.2 clearInstance

/// Clear SDK resources
+ (void)clearInstance;
Feature description:
This API is used to release SDK resources.

1.3 startVerifiWithConfig:

/// Start verification
- (void)startVerifiWithConfig:(VerificationConfig *)verifiConfig
withSuccCallback:(TXYVerifiKitProcessSucceedBlock)succCallback
withFialCallback:(TXYVerifiKitProcessFailedBlock)failCallback;
Feature description:
This API is used to start the identity verification process.
Input parameters:
Type
Parameter
Description
VerificationConfig
verifiConfig
Configuration information for starting this identity verification process
TXYVerifiKitProcessSucceedBlock
succCallback
Callback for successful SDK detection
TXYVerifiKitProcessFailedBlock
failCallback
Callback for failed SDK detection

1.4 TXYVerifiKitProcessSucceedBlock

Callback for successful SDK detection
/// 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);

1.5 TXYVerifiKitProcessFailedBlock

Callback for failed SDK detection
/// 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);

2.VerificationConfig

VerificationConfig is the configuration entity class used during the SDK startup, which mainly covers the following attributes:
Type
Name
Description
Default Value
NSString
ekycToken
Token requested from the server, which is used as the unique business credential for this identity verification process
Empty
NSString
licPath
Path of the license file applied for by client for user authorization
Empty
long
hyFaceTimeOut
Timeout period for a single action of identity verification
10000 ms (10s)
BOOL
isHiddenAlbum
Whether to hide the OCR album button
No
BOOL
isHiddenFlash
Whether to hide the OCR flashlight button
No
HYEkycLanguageType
languageType
Language setting for this process
DEFAULT (0)
OCRRegionType
ocrRegionType
Type of document to recognize
0
NSString
userUIBundleName
Custom UI bundle name
Nil
NSString
userLanguageBundleName
Custom language bundle name
nil
NSString
userLanguageFileName
Custom language filename
nil

3.VerifiCommDef

3.1 HYEkycLanguageType

This API provides the language configuration information of the default SDK page.
Type
Description
HY_EKYC_DEFAULT = 0
Auto
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.

3.2 OCRRegionType

Type of document to recognize
Enumerated Value
Description
OCR_TYPE_DEFULT = 0
Left empty by default
OCR_TYPE_HK
Hong Kong (China) identity card
OCR_TYPE_ML
Malaysian identity card
OCR_TYPE_PV_ID
Philippine driver's license
OCR_TYPE_PDL
Philippine voters ID card
OCR_TYPE_INDONESIA
Indonesian identity card
OCR_TYPE_SINGAPORE
Singapore identity card
OCR_TYPE_PH_TINID
Philippine TIN ID card
OCR_TYPE_PH_SSSID
Philippines SSS ID card
OCR_TYPE_PH_UMID
Philippines UMID card
OCR_TYPE_MLID_PASSPORT
Passport

4. Error codes and descriptions

Error
Error Code
Error Description
HY_SUCCESS
0
Success
HY_VERIFI_FAIL
-1
Detection failure
HY_VERIFI_OCR_FAIL
-2
Document recognition failed
HY_SDK_INNER_ERR
-4
Internal error
HY_INITIALIZATION_PARAMETER_EXCEPTION
310
Parameter initialization exception
HY_BUNDLE_CONFIGURATION_EXCEPTION
311
Bundle configuration exception
HY_YTSDK_CONFIGURATION_EXCEPTION
312
YouTu configuration exception
HY_PLEASE_CALL_FIRST_INIT_API
313
Call the initialization API first
HY_SDK_AUTH_FAILED
314
SDK authorization failure
HY_USER_VOLUNTARILY_CANCELED
315
It is manually canceled by user
HY_YTSDK_LOCAL_AUTH_FAILED
316
Local face detection failure of SDK
HY_CAMERA_OPEN_FAIL
317
Failed to enable the camera
HY_DONOT_SWITCH_APPS
318
Do not switch the application during identity verification
HY_CAMEREA_PERMISSION_EXCEPTION
319
Camera permission exception
HY_SDK_VEDIO_CUT_EXCEPTION
320
Failed to clip the video
HY_LIGHT_DATA_FORMAT_EXCEPTION
321
Invalid reflection data format
HY_GET_REMOTE_DATA_EXCEPTION
322
Error in getting remote data

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support