SDK Response
The response of the SDK will return in the following delegate
func onOCRResult(result: VIDVOCRResponse)It will return an enum result of type VIDVOCRResponse
VIDVOCRResponse Cases
VIDVOCRResponse CasesSuccess : Process finished successfully
CapturedImages: Images captured are returned in real-time
UserExit : Process terminated by the user with no errors
ServiceFailure : Process finished with the user's failure to pass the service requirements
BuilderError : Process terminated due to an error in the builder
Example
switch result {
case .success(let data):
// data of type VIDVOCRResult
case .builderError(let code, let message):
// builder error code & error message
case .serviceFailure(let code, let message, let data):
// service faluire error code & error message & data of type VIDVOCRResult
case .userExit(let step, let data):
// last step in the SDK & data of type VIDVOCRResult
case .capturedImages(capturedImageData: let capturedImageData):
// capturedImageData of type CapturedImageData
}Document verification plus - Case Handling
When using VIDVOCRResult.getData(), the returned ocrResult may include a documentVerificationPlusobject.
This object contains validation flags and quality signals that help you determine whether the document should be accepted, reviewed, recaptured, or rejected.
Fields Returned Under documentVerificationPlus
documentVerificationPlusfrontDataValidity
boolean
Overall validity of the front side based on greyscale flags + invalid fields list
backDataValidity
boolean
Overall validity of the back side based on greyscale flags + invalid fields list
isFrontGreyscale
boolean
Indicates whether the front side is greyscale
isBackGreyscale
boolean
Indicates whether the back side is greyscale
expired
boolean
Whether the document is recognized as expired
reviewRequired
List<String>
Fields that require attention (e.g. Nid, gender, expirydate…)
How to Read These Values
frontDataValidityandbackDataValidityact as parent flags → You can take action directly based on them if you want a simple validation flow.For more control, you can check detailed signals:
use greyscale flags if you want to reject black-and-white copies
use
reviewRequiredto apply different logic per field e.g. reject if nid is invalid but allow if gender is inconsistent
This allows fully customizable decision logic depending on your business rules.
Example Handling Logic
Advance confidence - Case Handling
When using VIDVOCRResult.getData(), the returned ocrResult may include a advancedConfidence object.
This object contains manipulation flags that help you determine whether the document should be accepted, reviewed, recaptured, or rejected.
Fields Returned Under advanceConfidence
advanceConfidencefraudDetectionZone
int
Parent zone flag → Result of face + image manipulation combined
faceFraudZone
int
Fraud confidence specifically related to face physical tampering
frontImageManipulationZone
int
Indicates signs of front image physical manpulation
Zone Meaning
0
Green
No manipulation detected
1
Yellow
Requires human review (suspicious)
2
Red
Strong indicators of fraud / manipulation
Example Handling Logic
Primary Response Object
VIDVOCRResult
Object Body
sessionID<string>
SDK Event Logs Response
Instance Responses
Success
VIDVOCRResult<object>
CapturedImages
UserExit
VIDVOCRResult<object>step<string>
ServiceFailure
VIDVOCRResult<object>code<string>message<string>
BuilderError
code<string>message<string>
Last updated