Constructor
new GrabbaPassport()
Access Grabba Passport MRZ reading capabilities via grabba.passport
Members
preferences :GrabbaPassportPreferences
Grabba passport preference identifiers.
Type:
Methods
isSupported(onSuccess, onError)
Determines if the currently connected Grabba supports passport MRZ reading functionality.
Parameters:
Name | Type | Description |
---|---|---|
onSuccess |
function | Called on success with the following parameters: {boolean} Boolean indicating if GrabbaPassport is supported. |
onError |
function | Called on error with the following parameters: {String} error description. |
Example
//Button to check if the connected Grabba supports passport MRZ reading functionality.
<button onclick="grabba.passport.isSupported(function(supported){
alert('Grabba passport supported is ' + supported);
},
function(errorString) {
alert('on error ' + errorString);
});">Is passport supported?</button>
registerCallback(callback, onError)
Register callbacks for passport MRZ reader related events.
If no callbacks are passed to this function, all present callbacks will be cleared.
If no callbacks are passed to this function, all present callbacks will be cleared.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | Called when a passport is read with the following parameters: {String} Passport MRZ string. |
onError |
function | Called on error with the following parameters: {String} error description. |
Example
//Register a passport callback
grabba.passport.registerCallback(
function (passportString){
alert('Passport MRZ: ' + passportString);
},
function(errorString) {
alert('on error ' + errorString);
});