Custom Providers¶
This page contains all available providers for the Document Reader feature, as well as instructions on how to import and implement them in a project using the SeamlessMobile SDK.
Regula Provider¶
This provider uses Regula services and supports both OCR Document Reading and RFID scanning functionalities.
How to Import:¶
Work in progress...
Install using Xcode¶
-
Open your project in Xcode.
-
Navigate to File ▸ Add Packages…
-
In the dialog that appears, enter the package repository URL for the SDK you want to add:
AMADocScanRegulaiOS
https://github.com/vbmobile/AMADocScanRegulaiOS -
Select the version to integrate. For new projects, we recommend using the latest available release (for example:
1.0.0-rc24). -
Choose the project and target to which the package should be added.
-
Click Add Package.
Once completed, Xcode will download the package and resolve all required dependencies automatically.
Install Using Package.swift¶
If you manage dependencies manually, add the SDKs to your Package.swift file.
1. Add the dependency¶
dependencies: [
.package(
url: "https://github.com/vbmobile/AMADocScanRegulaiOS",
exact: "1.0.0-rc24"
)
]
Replace
1.0.0-rc24with the intended version you wish to use.
2. Link the product to your target¶
.target(
name: "YourAppTarget",
dependencies: [
.product(name: "AMADocScanRegulaiOS", package: "AMADocScanRegulaiOS")
]
)
Replace
YourAppTargetwith the intended target you wish to use.
How to Instantiate:¶
Work in progress...
Creates a DocumentReaderScanProtocol using AMADocScanRegulaiOS provider
func amaDocScanRegulaiOSProviderSetup() {
var enrolmentConfig: EnrolmentConfig! // Not relevant for this example
func amaDocScanRegulaiOS() -> DocumentReaderScanProtocol {
guard
let licensePath = Bundle.main.path(
forResource: "<YOUR_REGULA_LICENCE_FILE>",
ofType: nil
),
(try? Data(contentsOf: URL(fileURLWithPath: licensePath))) != nil
else {
fatalError("Unable to read Regula License")
}
let documentReaderConfig: mdi_mob_sdk_doc_mrz_regula_ios.DocumentReaderConfig = DocumentReaderConfig(
multipageProcessing: false, // Single-page scanning
databaseID: "<YOUR_DATA_BASE_ID>", // Database id
scenario: .mrz // MRZ scanning scenario
)
return RegulaDocumentReaderScan(config: documentReaderConfig)
}
Enrolment.shared.initWith(enrolmentConfig: enrolmentConfig,
documentScanProvider: amaDocScanRegulaiOS(),
documentRFIDProvider: nil, // Not relevant for this example
ultralightProvider: nil, // Not relevant for this example
viewRegister: nil,
completionHandler: { result in
switch result {
case .success:
print("SDK is ready to use")
case let .failure(error):
print("Failure: \(error)")
}
})
}
How to Use:¶
Work in progress...
func readDocumentSampleUsage() {
// The view controller responsible for presenting the document scanner camera interface
var viewController: UIViewController!
Enrolment.shared.readDocument(
parameters: .init(readRFID: false),
viewController: viewController
) { result in
switch result {
case let .success(report):
print("Document Read: Success!")
print(report)
print(report.idDocument)
print(report.documentStatuses)
case let .failure(error):
print(error.featureError.description)
}
}
}
Amadeus DocScanMrz Provider¶
This provider uses Amadeus services and supports MRZ Document Reading functionalities.
How to Import:¶
implementation("com.amadeus.mdi.mob.sdk:ama-doc-scan-mrz:<1.0.0>")
Install using Xcode¶
-
Open your project in Xcode.
-
Navigate to File ▸ Add Packages…
-
In the dialog that appears, enter the package repository URL for the SDK you want to add:
AMADocScanMrziOS
https://github.com/vbmobile/AMADocScanMrziOS -
Select the version to integrate.
For new projects, we recommend using the latest available release (for example:1.0.0-rc24). -
Choose the project and target to which the package should be added.
-
Click Add Package.
Once completed, Xcode will download the package and resolve all required dependencies automatically.
Install Using Package.swift¶
If you manage dependencies manually, add the SDKs to your Package.swift file.
1. Add the dependency¶
dependencies: [
.package(
url: "https://github.com/vbmobile/AMADocScanMrziOS",
exact: "1.0.0-rc24"
)
]
Replace
1.0.0-rc24with the intended version you wish to use.
2. Link the product to your target¶
.target(
name: "YourAppTarget",
dependencies: [
.product(name: "AMADocScanMrziOS", package: "AMADocScanMrziOS")
]
)
Replace
YourAppTargetwith the intended target you wish to use.
How to Instantiate:¶
To initialize the Enrolment with the DocScanMrz. It can be done as follows.
val docScanMrzConfig = DocScanMrzConfig(
enableLogs = <true>,
docScanMrzKey: <YOUR DOC SCAN MRZ KEY>,
)
DocScanMrz.initialize(
context = this,
docScanMrzConfig = docScanMrzConfig
)
val context = ...
val enrolmentConfig = ...
val callback = ...
val documentReaderProvider = DocScanMrz.getInstance()
Enrolment.initialize(
context = context,
enrolmentConfig = enrolmentConfig,
documentReaderProvider = documentReaderProvider,
callback = callback
)
Creates a DocumentReaderScanProtocol using AMADocScanMrziOS provider
func docScanMrziOSProviderSetup() {
var enrolmentConfig: EnrolmentConfig! // Not relevant for this example
func amaDocScanMrziOS() -> DocumentReaderScanProtocol {
/// Specifies the expected document type (e.g. passport)
let documentType: DSDocumentType = .td3
/// Uses screen size to configure capture resolution
let bounds = UIScreen.main.bounds
/// Returns a PSS-based document scanner
return DocumentReaderScan(
documentType: documentType,
apiKey: "<YOUR_KEY>",
pixelWidth: Int(bounds.width),
pixelHeight: Int(bounds.height)
)
}
Enrolment.shared.initWith(enrolmentConfig: enrolmentConfig,
documentScanProvider: amaDocScanMrziOS(),
documentRFIDProvider: nil, // Not relevant for this example
ultralightProvider: nil, // Not relevant for this example
viewRegister: nil,
completionHandler: { result in
switch result {
case .success:
print("SDK is ready to use")
case let .failure(error):
print("Failure: \(error)")
}
})
}
How to Use:¶
Work in progress...
// The view controller responsible for presenting the document scanner camera interface
var viewController: UIViewController!
Enrolment.shared.readDocument(
parameters: .init(readRFID: false),
viewController: viewController
) { result in
switch result {
case let .success(report):
print("Document Read: Success!")
print(report)
print(report.idDocument)
print(report.documentStatuses)
case let .failure(error):
print(error.featureError.description)
}
}
Amadeus Doc RFID Read Provider¶
This provider uses Amadeus services and supports RFID scanning functionalities.
How to Import:¶
implementation("com.amadeus.mdi.mob.sdk:ama-doc-rfid-read:<1.0.0>")
Work in progress...
How to Instantiate:¶
To initialize the Enrolment with the DocRfidRead. It can be done as follows.
val docRfidReadConfig = DocRfidReadConfig(
apiConfig = DocRfidReadApiConfig(
baseUrl = <YOUR DOC RFID READ BASE URL>,
apiKey = <YOUR DOC RFID READ API KEY>
),
enableLogs = <ENABLE LOGS>,
)
DocRfidRead.initialize(
context = this,
docRfidReadConfig = docRfidReadConfig
)
val context = ...
val enrolmentConfig = ...
val callback = ...
val documentRfidReaderProvider = DocRfidRead.getInstance()
Enrolment.initialize(
context = context,
enrolmentConfig = enrolmentConfig,
rfidReaderProvider = documentRfidReaderProvider,
callback = callback
)
Work in progress...