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)
| Parameter | Description |
|---|---|
| docType | DocumentScannerType Defines the type of document which is to be scanned. |
| dvcId | String: (Optional) Document verification ID defines the configuration to be used for scanning and verification. |
| uid | String: (Optional) UID (Unique ID by using it you can filter in AdminX→Verifications). |
| delegate | DocumentScanDelegate 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.
| Parameter | Description |
|---|---|
| String | id: It represents the document's ID eg: driver license number. |
| String | category: Currently this SDK supports two categories for documents that can be registered i.e, identity_document or misc_document. |
| String | type: This represents the type of document that the user will try to register eg: dl, ppt, nationalid. |
| String | proofedBy: This identifies the entity responsible for proofing the document. |
The identity documents must have following baseline attributes.
| Parameter | Description |
|---|---|
| String | firstName: First name of document holder. |
| String | lastName: Last name of document holder. |
| String | dob: Date of birth {yyyyMMdd} of document holder. |
| String | doe: Date of expiry {yyyyMMdd} of document. |
| String | face: Base64 string of document holder's face photo. |
| String | image: Base64 string of document image. |