README
cordova-plugin-eid
Cordova plugin for reading Belgium Electronic ID cards on android devices.
Usage
cordova plugin add https://github.com/aximobile/cordova-plugin-eid
API
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
deviceType
contains the name of the current running device. The following devicetypes are allowed:Panasonic
Pokini
Grabba
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
properties
is a JSONArray of cardproperties. The following properties are allowed:firstname
name
otherName
nationality
sex
cardnumber
documentType
chipnumber
cardValidityDateBegin
cardValidityDateEnd
cardDeliveryMunicipality
nationalNumber
birthLocation
birthDate
nobleCondition
specialStatus
hashPhoto
duplicata
specialOrganisation
memberOfFamily
streetNumber
zipcode
municipality
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
properties
is 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);
});