Skip to main content

DocumentScannerViewController

public class DocumentScannerViewController: UIViewController

Class used to start the document scanner and give result back to the application.

Constructor

public convenience init(docType: DocumentScannerType, dvcId: String? = nil, uid: String? = nil, delegate: DocumentScanDelegate)

ParameterDescription
docTypeDocumentScannerType Defines the type of document which is to be scanned.
dvcIdString: (Optional) Document verification ID defines the configuration to be used for scanning and verification.
uidString: (Optional) UID (Unique ID by using it you can filter in AdminX→Verifications).
delegateDocumentScanDelegate The block to execute after the document scanning is completed.

Initializing the Scanner View Controller and Retrieving Results in delegate

let documentScannerVC = DocumentScannerViewController(docType: docType, delegate: delegate)
self.navigationController?.pushViewController(document, animated: false)

Override the DocumentScanDelegate function in your view controller to get callback from the scanning result.

public protocol DocumentScanDelegate {
func onDocumentScanResponse(status: Bool,
document: String?,
sessionID: String?,
error: ErrorResponse?)
}

Document Scanning result object

{
"data": {
"sessionResult": "String", // SUCCESS OR FAILED
"sessionId": "String", // Session ID
"document": {
// Driver License object
// Passport object
// IDCard object
},
"liveId": {
// LiveID Object
},
"token": "string" // document.proof_jwt
}
}

All documents (Identity and Miscellaneous) must have following baseline attributes.

ParameterDescription
Stringid: It represents the document's ID eg: driver license number.
Stringcategory: Currently this SDK supports two categories for documents that can be registered i.e, identity_document or misc_document.
Stringtype: This represents the type of document that the user will try to register eg: dl, ppt, nationalid.
StringproofedBy: This identifies the entity responsible for proofing the document.

The identity documents must have following baseline attributes.

ParameterDescription
StringfirstName: First name of document holder.
StringlastName: Last name of document holder.
Stringdob: Date of birth {yyyyMMdd} of document holder.
Stringdoe: Date of expiry {yyyyMMdd} of document.
Stringface: Base64 string of document holder's face photo.
Stringimage: Base64 string of document image.