The main class you should be using to communicate with a backend is IDSEnterpriseService
In order to create a new journey, you need to use submit document builder method by setting credentials, adding an extracted document image (Smart capture or Manual Extraction results) and finally uploading to IEOS backend.
Swift
// Build customisable request.
IDSEnterpriseService.submitDocumentConstructing({ (request: IDSEnterpriseSendRequest) in
request.credentials = credentials
request.addDocument(docImage)
request.isExtracted = false
request.documentSource = .identity
}, progress: nil) { (response: IDSEnterpriseResponse?, error: Error?) in
if
let error = error {
self.showPopup(title: "Error", message: error.localizedDescription)
} else
{
let information = "Reference: \(String(describing: response?.scanReference)) \n Result: \(String(describing: response?.highLevelResult))"
self.showPopup(title: "Success", message: information)
}
}
Once you receive a response, you should follow required action requested by the backend and invoke specific component.
Swift
// Check what's the next required action
response.requiredActionState.action
To continue journey with the next step, you need to provide journey ID from the initial response, hence all metadata gets uploaded to the right place
Swift
// Backend asked for selfie, you used selfie scanner to take an image, now you need to upload it to the backend IDSEnterpriseService.submitDocumentConstructing({ (request: IDSEnterpriseSendRequest) in request.credentials = credentials request.addSelfieImage(selfieImage) request.journeyID = firstResponse.journeyID request.documentSource = .identity }, progress: nil) { (response: IDSEnterpriseResponse?, error: Error?) in if let error = error { self.showPopup(title: "Error", message: error.localizedDescription) } else { let information = "Reference: (String(describing: response?.scanReference)) \n Result: (String(describing: response?.highLevelResult))" self.showPopup(title: "Success", message: information) } }
Please Note: Liveness: For liveness and NFC steps, those components will take care of uploading everything to the backend.
The journey ends when the required action is “NONE”.
After the final step, you can retrieve full journey result using getJourney() call in IDSEnterpriseService