AAMVA Barcode Verifier
Defined in framework ScanditIdCapture
- enum AamvaBarcodeVerificationStatus
Added in version 6.26.0
The verification status returned by the barcode verifier
- authentic
Added in version 6.26.0
The barcode is authentic
- likelyForged
Added in version 6.26.0
The barcode is likely forged
- forged
Added in version 6.26.0
The barcode is forged
- AamvaBarcodeVerificationResult
open class AamvaBarcodeVerificationResult : NSObject
Added in version 6.15.0
The result of a verification of AAMVA-compliant personal identification document done by AamvaBarcodeVerifier.
- allChecksPassed
open var allChecksPassed:
Bool{ get }Added in version 6.15.0
All checks passed and nothing suspicious about the document was detected.
- status
open var status: AamvaBarcodeVerificationStatus { get }
Added in version 6.26.0
Verification status containing the result of the verification
- AamvaBarcodeVerifier
open class AamvaBarcodeVerifier : NSObject
Added in version 6.15.0
Deprecated since version 7.6.0: Replaced by IdCaptureSettings.rejectForgedAamvaBarcodes
Validates the authenticity of the document by scanning the barcode on the back. This verifier supports documents that follow the Driver License/Identification Card specification by the American Association of Motor Vehicle Administrators (AAMVA). It requires either the full (i.e. front & back) scanning mode or a single-sided scan of the back of the document. Start with creating a capture context and the verifier:
let dataCaptureContext = DataCaptureContext(licenseKey: "-- ENTER YOUR SCANDIT LICENSE KEY HERE --") let verifier = AamvaBarcodeVerifier(context: dataCaptureContext)
Then either initialize the front & back scanning mode:
let = IdCaptureSettings() idCaptureSettings.supportedDocuments = [ .dlVIZ ] idCaptureSettings.capturedSides = .frontAndBack let idCapture = IdCapture(context: dataCaptureContext, settings: settings)
Or initialize single-sided scanning of the back of the document:
let settings = IdCaptureSettings() settings.supportedDocuments = [ .aamvaBarcode ] let idCapture = IdCapture(context: dataCaptureContext, settings: settings)
Once the capture is complete, trigger the verification process. This process is asynchronous and the result will be delivered once the verification has been completed:
func idCapture(_ idCapture: IdCapture, _ capturedId: CapturedId) { guard let barcode = capturedId.aamvaBarcodeResult else { return } // Trigger the verification. This process is asynchronous. verifier.verify(capturedId) { result, error in if let error = error { // Verification error } else if let result = result { if result.allChecksPassed { // Nothing suspicious was detected. } else { // Document may be fraudulent or tampered with - proceed with caution. } } } }
- init
convenience init(context: DataCaptureContext)
Added in version 6.15.0
Creates a new instance of this verifier.
- verify
open func verify(_ capturedId: CapturedId, completionHandler: @escaping @Sendable (AamvaBarcodeVerificationResult?, (any Error)?) ->
Void) ->VoidAdded in version 6.15.0
Asynchronously conduct the verification of the specified AAMVA-compliant personal identification document.
- verify
open func verify(_ capturedId: CapturedId) async throws -> AamvaBarcodeVerificationResult
Added in version 6.15.0
Asynchronously conduct the verification of the specified AAMVA-compliant personal identification document.