cordova-plugin-eid v1.2.7
cordova-plugin-eid
Cordova plugin for reading Belgium Electronic ID cards on android devices.
Usage
cordova plugin add https://github.com/aximobile/cordova-plugin-eidAPI
This plugin provides a global object "EidPlugin" containing 4 Android API calls for reading Belgian ID cards.
Overview
- EidPlugin.initialize(deviceType, successCallback, rejectCallback)
- EidPlugin.readCard(properties, successCallback, rejectCallback)
- EidPlugin.listenForCard(properties, successCallback, rejectCallback)
- EidPlugin.stopListeningForCard(successCallback, rejectCallback)
EidPlugin.initialize(deviceType, successCallback, rejectCallback)
Initialize the plugin for a specific device. This method should always be called first before any other API call.
Options
deviceTypecontains the name of the current running device. The following devicetypes are allowed:PanasonicPokiniGrabba
EidPlugin.readCard(properties, successCallback, rejectCallback)
Read specific properties from an ID card. This method will return a success or error callback when it has finished reading.
Options
propertiesis a JSONArray of cardproperties. The following properties are allowed:firstnamenameotherNamenationalitysexcardnumberdocumentTypechipnumbercardValidityDateBegincardValidityDateEndcardDeliveryMunicipalitynationalNumberbirthLocationbirthDatenobleConditionspecialStatushashPhotoduplicataspecialOrganisationmemberOfFamilystreetNumberzipcodemunicipality
Example:
var properties = ['cardnumber', 'firstname', 'name', 'zipcode'];
EidPlugin.readCard(properties, function(result){
console.log('successfully retrieved card data: ', result);
}, function(error){
console.log('An error occurred while retrieving card data: ', error);
});EidPlugin.listenForCard(properties, successCallback, rejectCallback)
Listen for ID card input and read specific ID card properties when inserted. This method will return a success or error callback when it has finished reading.
Options
propertiesis a JSONArray of properties. The same properties can be used as in the EidPlugin.readCard API call.
Example:
var properties = ['cardnumber', 'firstname', 'name', 'zipcode'];
EidPlugin.listenForCard(properties, function(result){
console.log('successfully retrieved card data: ', result);
}, function(error){
console.log('An error occurred while retrieving card data: ', error);
});