Mobile Driver's License Processing
Find out more about Mobile Driver's License (mDL).
The mDL processing flow consists of several steps:
- Install Dependencies
- Declare Permissions
- Initialize Document Reader SDK
- Add Certificate
- Start mDL Processing
- Handle Processing Results
Install Dependencies
Follow the Installation guide to integrate the Document Reader SDK into your applications.
Also, add the BTDevice dependency:
pod 'BTDevice'
implementation 'com.regula.btdevice:api:+@aar'
implementation("com.regula.btdevice:api:+@aar")
flutter_document_reader_btdevice:
"@regulaforensics/document-reader-btdevice": "latest"
<!-- Android -->
<PackageReference Include="Xamarin.DocumentReader.BTDevice.Android" Version="*"/>
<!-- iOS -->
<PackageReference Include="Xamarin.DocumentReader.BTDevice.iOS" Version="*"/>
Declare Permissions
- То use Bluetooth for the mDL processing, declare the corresponding permissions:
Add the following permission to your Info.plist:
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Requires access to your phone’s Bluetooth module.</string>
Bluetooth permissions are imported from the BTDevice library and automatically merged to the application's AndroidManifest.xml, no additional actions from your side are required.
Note that you will also need to request the Bluetooth permissions at runtime.
For Android, add the following to android/app/src/main/AndroidManifest.xml:
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
For iOS, add the following to ios/Runner/Info.plist:
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Requires access to your phone’s Bluetooth module.</string>
For Android, add the following to Platforms/Android/AndroidManifest.xml:
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
For iOS, add the following to Platforms/iOS/Info.plist:
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Requires access to your phone’s Bluetooth module.</string>
- To use NFC for the mDL processing, declare the corresponding permissions:
1. Add Near Field Communication Tag Reading under the Capabilities tab for the project’s target:

2. Add the NFCReaderUsageDescription permission to your Info.plist file, this is needed to access the NFC hardware:
<key>NFCReaderUsageDescription</key>
<string>NFC tag to read NDEF messages</string>
3. To access a particular function of the electronic document or to a file in its memory, it is required to select the corresponding applications first. It's a requirement of Apple to specify them explicitly in Info.plist.
Declare com.apple.developer.nfc.readersession.iso7816.select-identifiers—a list of application identifiers that the app must be able to read according to ISO7816:
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
<string>A0000002480400</string>
<string>D2760000850101</string>
</array>
Identifiers of all supported by the Document Reader SDK standard applications are given below.
| Identifier | Description |
|---|---|
| A0000002480400 | NDEF application on compatible NFC tags |
| D2760000850101 | mdoc/mDL NFC proximity communication |
Access to NFC hardware is mandatory for the mDL processing via NFC. To grant this permission, add the NFC key to your AndroidManifest file:
<uses-permission android:name="android.permission.NFC" />
If you need to start the mDL processing with a vibration, add the optional VIBRATE permission:
<uses-permission android:name="android.permission.VIBRATE" />
Initialize Document Reader SDK
After installation, you need to initialize the Document Reader SDK with proper license that supports mDL processing.
Add Certificate
To retrieve mDL data over NFC or Bluetooth, you must add the appropriate trusted certificate chain—CSCA/DSC (Country Signing Certification Authority / Document Signer Certificate) for NFC access, or the Issuer Certificate Chain for Bluetooth Data Retrieval.
For details about adding the certificate to your application, see Add Certificates on Initialization.
While adding the certificate, use the CBOR (Concise Binary Object Representation) PKD resource type. See the API reference below.
Start mDL Processing
The mDL reading process consists of two phases: the Device Engagement and Data Retrieval.
For details see the Mobile Driver's License (mDL) Overview.
The most common combinations of engagement and retrieval are as follows:
- Device Engagement via QR code and Data Retrieval via Bluetooth
- Both Device Engagement and Data Retrieval via NFC
Both variants are available using the same method for combined Engagement + Retrieval (with predefined UI). See the examples below.
- To engage the device via QR code and retrieve mDL data via Bluetooh, use:
let dataRetrieval = DocReader.DataRetrieval(deviceRetrieval: .BLE)
DocReader.shared.startReadMDL(fromPresenter: self, engagementType: .QR, dataRetrieval: dataRetrieval) { action, results, error in
}
RGLDataRetrieval *dataRetrieval = [[RGLDataRetrieval alloc] initWithDeviceRetrieval:RGLeMDLDeviceRetrievalBLE];
[[RGLDocReader shared] startReadMDLFromPresenter:self engagementType:RGLeMDLDeviceEngagementQR dataRetrieval:dataRetrieval completion:^(RGLDocReaderAction action, RGLDocumentReaderResults * _Nullable results, NSError * _Nullable error) {
}];
val dataRetrieval = DataRetrieval(eMDLDeviceRetrieval.BLE)
DocumentReader.Instance().startReadMDL(this@MainActivity ,eMDLDeviceEngagement.QR, dataRetrieval, object : IDocumentReaderCompletion {
override fun onCompleted(
action: Int,
documentReaderResults: DocumentReaderResults?,
e: DocumentReaderException?
) {
if (action == DocReaderAction.COMPLETE) {
//processingResults(documentReaderResults)
}
}
})
DataRetrieval dataRetrieval = new DataRetrieval(eMDLDeviceRetrieval.BLE);
DocumentReader.Instance().startReadMDL(getActivity(), eMDLDeviceEngagement.QR, dataRetrieval, new IDocumentReaderCompletion() {
@Override
public void onCompleted(int action, @Nullable DocumentReaderResults results, @Nullable DocumentReaderException error) {
if (action == DocReaderAction.COMPLETE) {
//processingResults(results)
}
}
});
// TODO
// TODO
// Android
// TODO
// iOS
// TODO
// TODO
// TODO
// TODO
- To engage the device via NFC and retrieve mDL data via NFC, use:
let dataRetrieval = DocReader.DataRetrieval(deviceRetrieval: .NFC)
DocReader.shared.startReadMDL(fromPresenter: self, engagementType: .NFC, dataRetrieval: dataRetrieval) { action, results, error in
}
RGLDataRetrieval *dataRetrieval = [[RGLDataRetrieval alloc] initWithDeviceRetrieval:RGLeMDLDeviceRetrievalNFC];
[[RGLDocReader shared] startReadMDLFromPresenter:self engagementType:RGLeMDLDeviceEngagementNFC dataRetrieval:dataRetrieval completion:^(RGLDocReaderAction action, RGLDocumentReaderResults * _Nullable results, NSError * _Nullable error) {
}];
val dataRetrieval = DataRetrieval(eMDLDeviceRetrieval.NFC)
DocumentReader.Instance().startReadMDL(this@MainActivity ,eMDLDeviceEngagement.NFC, dataRetrieval, object : IDocumentReaderCompletion {
override fun onCompleted(
action: Int,
documentReaderResults: DocumentReaderResults?,
e: DocumentReaderException?
) {
if (action == DocReaderAction.COMPLETE) {
//processingResults(documentReaderResults)
}
}
})
DataRetrieval dataRetrieval = new DataRetrieval(eMDLDeviceRetrieval.NFC);
DocumentReader.Instance().startReadMDL(getActivity(), eMDLDeviceEngagement.NFC, dataRetrieval, new IDocumentReaderCompletion() {
@Override
public void onCompleted(int action, @Nullable DocumentReaderResults results, @Nullable DocumentReaderException error) {
if (action == DocReaderAction.COMPLETE) {
//processingResults(results)
}
}
});
// TODO
// TODO
// Android
// TODO
// iOS
// TODO
// TODO
// TODO
// TODO
For advanced dedicated methods, see the separate Device Engagement and Data Retrieval sections.
You also have the capability to control the Intent to Retain for each value of mDL fields to be read.
You can use the Document Request Presets to manage what fields exactly need to be read.
Handle Processing Results
Like in the case with the physical identity document recognition, the mDL data fields in the response are divided into the Text and Graphic values.
Additionally, several Status checks are available for Mobile Driver's License:
mDL— demonstrates whether an mDL is successfully validatedageanddetailsAge— demonstrates the results of the age checks over various concrete values
Explore details for the concrete platforms below.