Identity Document Verification
The Android and iOS SDKs provide a streamlined way to integrate identity verification flows into your mobile application. These flows support the capture and validation of the following user credentials: Email address, Passport, ID Card, Driving License.
Integrate the SDK’s pre-built UI components into your app to guide users through each verification step. This includes interfaces for entering an email address, capturing images of passports or ID cards, and confirming submitted data.
After verification, the SDK stores the verified credentials securely in the device's local database. This can later be used to fulfill presentation requests.
iOS
Self SDK support verify both passport and other document such as identity card and driving license.
To read data from an e-passport. You need to setup ability to read NFC chip from passport First, we need to add Near Field Communication Tag Reading
capability to the entitlement file
Second, we need to add NFCReaderUsageDescription
to application's Info.plist file
| <key>NFCReaderUsageDescription</key>
<string>This app uses NFC to scan passports</string>
|
And a list of application identifiers that the app supports into the Info.plist file
| <key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
<string>A0000002472001</string>
<string>A0000002471001</string>
<string>00000000000000</string>
</array>
```
Notes: You should use the custom Info.plist file to add the above keys to the Info.plist file
### Verify a document
We design the verify document as a view. So to call the document flow. You should follow this below codes
```swift
@State private var showVerifyDocument: Bool = false
// display document flow as a full modal view
var body: some View {
VStack {
// Your main content
}
.fullScreenCover(isPresented: $showVerifyDocument, onDismiss: {
// document view dismissed
}, content: {
DocumentFlow(account: account, autoCaptureImage: false, onResult: { success in
print("Verify document finished: \(success)")
showVerifyDocument = false
// reload view to display document's credential
})
})
}
|
Android
Below are code examples in a simple MainActivity on how to integrate the document verification flow in the app.
| class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// setup sdk and account
....
setContent {
val claims = remember { mutableStateListOf<Claim>() }
// get verified credentials from sdk
fun refreshClaims() {
val credentials = account.credentialsByType()
claims.addAll(credentials.flatMap { cred -> cred.credentials.flatMap { it.claims() } })
}
NavHost(navController = navController, startDestination = "main") {
// integrate passport, idcard verification flow
addDocumentVerificationRoute(navController, route = "documentRoute", selfModifier = selfModifier, account = { account }, isDevMode = { false },
onFinish = { isSuccess, error ->
if (isSuccess) {
refreshClaims() // refresh credentials to display
coroutineScope.launch(Dispatchers.Main) {
Toast.makeText(applicationContext, "Document verification successfully", Toast.LENGTH_LONG).show()
}
}
}
)
}
}
}
}
|