Grabba Driver for iOS
Unified driver for Grabba devices on the iOS operating system
All Classes Functions Enumerations Enumerator Properties Modules Pages
<GrabbaMRZ_Protocol> Protocol Reference

Description

Interface for receiving MRZ reader events.

Objects which implement this protocol may receive callbacks when these events occur, via delegation from a GrabbaMRZ_Listener object.

Note that this protocol need not be directly implemented; it may be simpler to subclass GrabbaMRZ_Listener and thereby receive the events directly.

Thread safety: This interface is intended to be thread-safe; any classes deriving from it should ensure that the relevant methods are callable from any thread.

See also
GrabbaMRZ_API for related API functions

Instance Methods

(void) - dataEvent:
 Callback which is invoked when a machine-readable zone (MRZ) is read. More...
 
(void) - validatedDataEvent:
 Callback which is invoked when a machine-readable zone (MRZ) is read and successfully validated. More...
 
(void) - validationFailedEvent:reason:
 Callback which is invoked when a machine-readable zone (MRZ) is read, but fails validation. More...
 

Method Documentation

◆ dataEvent:()

- (void) dataEvent: (GrabbaMRZ_Data *_Nonnull)  data

Callback which is invoked when a machine-readable zone (MRZ) is read.

This event is triggered when the optical character recognition (OCR) module encounters an MRZ (swiped through the Grabba device's reading slot) and is able to read data from it.

This event will be triggered regardless of data validity - i.e. even if some characters are not read successfully, or if the data which was read does not conform to any of the formats defined in ICAO 9303.

Most applications can safely ignore this event unless they need the raw MRZ data even from validated MRZs - consider using validatedDataEvent and/or validationFailedEvent instead. Each trigger of this event will be coupled with exactly one of those two (with the choice depending on the validation outcome); no guarantees are made as to the order in which the two events are triggered.

Parameters
dataPassport, visa or identity card data which was read

◆ validatedDataEvent:()

- (void) validatedDataEvent: (GrabbaMRZ_Validated *_Nonnull)  data

Callback which is invoked when a machine-readable zone (MRZ) is read and successfully validated.

This event is triggered when the optical character recognition (OCR) module encounters an MRZ (swiped through the Grabba device's reading slot), it is able to successfully read data in one of the formats defined in ICAO 9303, and the read data passes all validation checks for that format.

This event is mutually exclusive with validationFailedEvent; applications which handle this event should typically ignore dataEvent and pick up validationFailedEvent if they need to process scan failures. If dataEvent is handled, however, it should be noted that no guarantees are made as to the order in which this event and that event will be triggered after a scan.

Parameters
dataPassport, visa or identity card data which was read and validated

◆ validationFailedEvent:reason:()

- (void) validationFailedEvent: (GrabbaMRZ_Data *_Nonnull)  data
reason: (NSString *_Nonnull)  reason 

Callback which is invoked when a machine-readable zone (MRZ) is read, but fails validation.

This event is triggered when the optical character recognition (OCR) module encounters an MRZ (swiped through the Grabba device's reading slot), but the data which was read does not pass validation checks. This could be due to any of the following causes:

  • The scan was incomplete (e.g. one end of the MRZ did not pass the read head)
  • One or more characters could not be successfully identified
  • The MRZ was in a format not consistent with those defined by ICAO 9303
  • The MRZ was incorrectly written (e.g. check digit incorrectly calculated)

This event is mutually exclusive with validatedDataEvent; applications which handle this event should typically ignore dataEvent and pick up validatedDataEvent if they need to process scan failures. If dataEvent is handled, however, it should be noted that no guarantees are made as to the order in which this event and that event will be triggered after a scan.

Parameters
dataPassport, visa or identity card data which was read, but failed to pass validation
reasonBrief description of the validation failure reason