Enroll from the document photo
1. Retrieve the user photo (from the document)
KeylessDocument.scanDocument() {
when (it) {
is DocumentResult.Success -> {
// path where the document photo is saved
Log.d(TAG, "Photo path ${it.value.facePath}")
}
is DocumentResult.Failure -> {
Log.d(TAG, "Error ${it.error}")
}
}KeylessDocument.scanDocument() { result in
switch result {
case .success(let document):
// UIImage containing the document photo
let photo: UIImage? = document.passportImage
case .failure(let error):
print("Error: \(error)")
}
}DocumentResult<EDocument> documentResult = await KeylessDocument.instance.scanDocument();
switch (documentResult) {
case DocumentSuccess<EDocument>(data: final document):
String photoPath = 'Document: ${document.facePath}, ...';
break;
case DocumentFailure(message: final error, code: final code, errorType: final type):
String error = 'Document Error: $error $code ($type)';
break;2. Confirm the document is valid
3. Enroll using the photo (from the document)
4. Authenticate using the face (live person)
Last updated
Was this helpful?