Skip to content

Commit

Permalink
Merge pull request #49 from BlinkID/feature/malaysia-support/v1.5.1
Browse files Browse the repository at this point in the history
Feature/malaysia support/v1.5.1
  • Loading branch information
Jure Čular authored Mar 26, 2018
2 parents f1d8d2d + 9db6c3c commit 74446fd
Show file tree
Hide file tree
Showing 13 changed files with 592 additions and 152 deletions.
2 changes: 1 addition & 1 deletion BlinkID/initIOSFramework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# enter into ios project folder
pushd src/ios/

VERSION='2.16.0'
VERSION='2.16.1'

# check if Microblink framework and bundle already exist
if [ ! -d 'blinkid-ios' ] ; then
Expand Down
2 changes: 1 addition & 1 deletion BlinkID/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blinkid",
"version": "1.5.0",
"version": "1.5.1",
"description": "A small and powerful ID card scanning library",
"cordova": {
"id": "com.microblink.blinkid",
Expand Down
2 changes: 1 addition & 1 deletion BlinkID/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="com.microblink.BlinkIdScanner"
version="1.5.0">
version="1.5.1">

<name>BlinkIdScanner</name>
<description>A small and powerful ID card scanning library</description>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,40 @@

enum RecognizerType {

DOCUMENTFACE("DocumentFace"),
BARCODE("Barcode"),
DEDL("DEDL"),
DOCUMENTDETECTOR("DocumentDetector"),
EUDL("EUDL"),
USDL("USDL"),
MRTD("MRTD"),
MYKAD("MyKad"),
PDF417("PDF417"),
UKDL("UKDL"),

GERMAN_ID_BACK("GermanIDBack"),
GERMAN_ID_FRONT("GermanIDFront"),
GERMAN_OLD_ID("GermanOldID"),
GERMAN_PASSPORT("GermanPassport"),

SINGAPORE_ID_FRONT("SingaporeIDFront"),
SINGAPORE_ID_BACK("SingaporeIDBack"),

UAE_ID_BACK("UnitedArabEmiratesIDBack"),
UAE_ID_FRONT("UnitedArabEmiratesIDFront"),

UNKNOWN("");
DOCUMENTFACE("DocumentFace", "DocumentFace result"),
BARCODE("Barcode", "Barcode result"),
DEDL("DEDL", "DEDL result"),
DOCUMENTDETECTOR("DocumentDetector", "DocumentDetector result"),
EUDL("EUDL", "EUDL result"),
USDL("USDL", "USDL result"),
MRTD("MRTD", "MRTD result"),
PDF417("PDF417", "Barcode result"),
UKDL("UKDL", "UKDL result"),

MYKAD_FRONT("MyKadFront", "MyKadFront result"),
MYKAD_BACK("MyKadBack", "MyKadBack result"),
IKAD("IKad", "IKad result"),
MY_TENTERA("MyTentera", "MyTentera result"),

GERMAN_ID_BACK("GermanIDBack", "GermanBackID result"),
GERMAN_ID_FRONT("GermanIDFront", "GermanFrontID result"),
GERMAN_OLD_ID("GermanOldID", "GermanOldID result"),
GERMAN_PASSPORT("GermanPassport", "GermanPassport result"),

SINGAPORE_ID_FRONT("SingaporeIDFront", "SingaporeFrontID result"),
SINGAPORE_ID_BACK("SingaporeIDBack", "SingaporeBackID result"),

UAE_ID_BACK("UnitedArabEmiratesIDBack", "UnitedArabEmiratesIDBack result"),
UAE_ID_FRONT("UnitedArabEmiratesIDFront", "UnitedArabEmiratesIDFront result"),

UNKNOWN("", "");

public final String id;
public final String resultId;

RecognizerType(String id) {
RecognizerType(String id, String resultId) {
this.id = id;
this.resultId = resultId;
}

static RecognizerType fromId(String id) {
Expand Down
201 changes: 181 additions & 20 deletions BlinkID/src/ios/sources/CDVBlinkIdScanner.m

Large diffs are not rendered by default.

61 changes: 53 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,20 @@ To run the script, you'll need BASH environment on Windows (Linux and MacOS use
To use the plugin you call it in your Javascript code like the demo application:

```javascript
/**
/**
* Use these scanner types
* Available: "PDF417", "USDL", "Barcode", "MRTD", "EUDL", "UKDL", "DEDL", "MyKad", "GermanOldID", "GermanIDFront", "GermanIDBack", "GermanPassport", "UnitedArabEmiratesIDFront", "UnitedArabEmiratesIDBack", "SingaporeIDFront", "SingaporeIDBack", "DocumentFace", "DocumentDetector"
* Available: "PDF417", "USDL", "Barcode", "MRTD", "EUDL", "UKDL", "DEDL", "MyKadFront", "MyKadBack", "IKad", "MyTentera", "GermanOldID", "GermanIDFront", "GermanIDBack", "GermanPassport", "UnitedArabEmiratesIDFront", "UnitedArabEmiratesIDBack", "SingaporeIDFront", "SingaporeIDBack", "DocumentFace", "DocumentDetector"
* PDF417 - scans PDF417 barcodes
* USDL - scans barcodes located on the back of US driver's license
* Barcode - scans various types of codes (i.e. QR, UPCA, UPCE...). Types of scanned codes can be modified in plugin classes (Explained later in this readme). By default, scanned codes are set to: Code 39, Code 128, EAN 13, EAN 8, QR, UPCA, UPCE
* MRTD - scans Machine Readable Travel Document, contained in various IDs and passports
* EUDL - scans the front side of European driver's license
* UKDL - scans the front side of United Kingom driver's license
* DEDL - scans the front side of German driver's license
* MyKad - scans the front side of Malaysian ID card
* MyKadFront - scans the front side of Malaysian ID card
* MyKadBack - scans the back side of Malaysian ID card
* IKad - scans the front side of IKad card
* MyTentera - scans the front side of Malaysian Tentera card
* GermanOldID - scans the front side of old German ID card
* GermanIDFront - scans the front side of German ID card
* GermanIDBack - scans the back side of German ID card
Expand All @@ -193,7 +196,7 @@ To use the plugin you call it in your Javascript code like the demo application:
*
* Variable << types >> declared below has to contain all the scanners needed by your application. Applying additional scanners will slow down the scanning process
*/
var types = ["USDL", "MRTD", "Barcode"];;
var types = ["USDL", "MRTD", "Barcode"];

/**
* Image type defines type of the image that will be returned in scan result (image is returned as Base64 encoded JPEG)
Expand Down Expand Up @@ -325,7 +328,7 @@ scanButton.addEventListener('click', function() {
"First name: " + fields[kPPeudlFirstName] + "<br>" +
"Last name: " + fields[kPPeudlLastName] + "<br>";

} else if (recognizerResult.resultType == "MyKad result") {
} else if (recognizerResult.resultType == "MyKadFront result") {

resultDiv.innerHTML = /** Personal information */
"ID Type: " + fields[kPPDataType] + "<br>" +
Expand All @@ -340,6 +343,45 @@ scanButton.addEventListener('click', function() {
"Religion: " + fields[kPPmyKadReligion] + "<br>" +
"Sex: " + fields[kPPmyKadSex] + "<br>";

} else if (recognizerResult.resultType == "MyKadBack result") {

resultDiv.innerHTML = /** Personal information */
"ID Type: " + fields[kPPDataType] + "<br>" +
"NRIC Number: " + fields[kPPmyKadNricNumber] + "<br>" +
"Extended NRIC Number: " + fields[kPPmyKadBackExtendedNricNumber] + "<br>" +
"Birth Date: " + fields[kPPmyKadBackBirthDate] + "<br>" +
"Sex: " + fields[kPPmyKadBackSex] + "<br>";

} else if (recognizerResult.resultType == "MyTentera result") {

resultDiv.innerHTML = /** Personal information */
"ID Type: " + fields[kPPDataType] + "<br>" +
"Army Number: " + fields[kPPmyTenteraArmyNumber] + "<br>" +
"NRIC Number: " + fields[kPPmyTenteraNricNumber] + "<br>" +
"Address: " + fields[kPPmyTenteraAddress] + "<br>" +
"Address ZIP Code: " + fields[kPPmyTenteraAddressZipCode] + "<br>" +
"Address Street: " + fields[kPPmyTenteraAddressStreet] + "<br>" +
"Address City: " + fields[kPPmyTenteraAddressCity] + "<br>" +
"Address State: " + fields[kPPmyTenteraAddressState] + "<br>" +
"Birth Date: " + fields[kPPmyTenteraBirthDate] + "<br>" +
"Full Name: " + fields[kPPmyTenteraFullName] + "<br>" +
"Religion: " + fields[kPPmyTenteraReligion] + "<br>" +
"Sex: " + fields[kPPmyTenteraSex] + "<br>";

} else if (recognizerResult.resultType == "IKad result") {

resultDiv.innerHTML = /** Personal information */
"ID Type: " + fields[kPPDataType] + "<br>" +
"Address: " + fields[kPPiKadAddress] + "<br>" +
"Birth Date: " + fields[kPPiKadDateOfBirth] + "<br>" +
"Employer: " + fields[kPPiKadEmployer] + "<br>" +
"Expiry Date: " + fields[kPPiKadExpiryDate] + "<br>" +
"Name: " + fields[kPPiKadName] + "<br>" +
"Nationality: " + fields[kPPiKadNationality] + "<br>" +
"Passport Number: " + fields[kPPiKadPassportNumber] + "<br>" +
"Sector: " + fields[kPPiKadSector] + "<br>" +
"Sex: " + fields[kPPiKadSex] + "<br>";

} else if (recognizerResult.resultType == "GermanOldID result") {

resultDiv.innerHTML = /** Personal information */
Expand Down Expand Up @@ -417,7 +459,7 @@ scanButton.addEventListener('click', function() {
"Date of issue: " + fields[kPPsingaporeDateOfIssue] + "<br>" +
"Blood group: " + fields[kPPsingaporeBloodGroup] + "<br>" +
"Address: " + fields[kPPsingaporeAddress] + "<br>";

} else if (recognizerResult.resultType == "DocumentDetector result") {

resultDiv.innerHTML = "Found a document";
Expand Down Expand Up @@ -459,7 +501,7 @@ scanButton.addEventListener('click', function() {

types, imageTypes, licenseiOs, licenseAndroid, language
);
});;
});
```

+ Available scanners are:
Expand All @@ -470,7 +512,10 @@ scanButton.addEventListener('click', function() {
+ **EUDL** - scans the front of European driver's license
+ **UKDL** - scans the front of United Kingom driver's license
+ **DEDL** - scans the front of German driver's license
+ **MyKad** - scans the front of Malaysian ID cards
+ **MyKadFront** - scans the front side of Malaysian ID card
+ **MyKadBack** - scans the back side of Malaysian ID card
+ **IKad** - scans the front side of IKad card
+ **MyTentera** - scans the front side of Malaysian Tentera card
+ **GermanOldID** - scans the front of old German ID cards
+ **GermanIDFront** - scans the front of German ID cards
+ **GermanIDBack** - scans the back of German ID cards
Expand Down
13 changes: 13 additions & 0 deletions Release notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 1.5.1
- renamed `MyKad` recognizer to `MyKadFront`
- updated iOS SDK to v2.16.1
- added the following recognizers:
- `iKad` - scans the front of iKad cards
- `MyTentera` - scans the front of MyTentera cards
- `MyKadBack` - scans the back of MyKad cards

## 1.5.0
- added the following recognizers:
- `SingaporeIDFrontRecognizer` - scans the front of Singapore ID cards
- `SingaporeIDBackRecognizer` - scans the back of Singapore ID cards

## 1.4.4
- added the following recognizers:
- `UnitedArabEmiratesIDBack` - scans the back of United Arab Emirates ID cards
Expand Down
2 changes: 2 additions & 0 deletions www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ <h1>Demo App</h1>
<script type="text/javascript" src="js/usdl_keys.js"></script>
<script type="text/javascript" src="js/mrtd_keys.js"></script>
<script type="text/javascript" src="js/mykad_keys.js"></script>
<script type="text/javascript" src="js/mytentera_keys.js"></script>
<script type="text/javascript" src="js/ikad_keys.js"></script>
<script type="text/javascript" src="js/eudl_keys.js"></script>
<script type="text/javascript" src="js/german_id_keys.js"></script>
<script type="text/javascript" src="js/german_passport_keys.js"></script>
Expand Down
40 changes: 40 additions & 0 deletions www/js/ikad_keys.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//
// ikad_keys.js
// MicroBlink BlinkID library
//
// Copyright (c) 2015 MicroBlink. All rights reserved.
//


//pragma mark - Keys for obtaining data on Malaysian identity cards

var kPPiKadDataType = "PaymentDataType";


var kPPiKadAddress = "iKadAddress.Address";


var kPPiKadDateOfBirth = "iKadDateOfBirth.DateOfBirth";


var kPPiKadEmployer = "iKadEmployer.Employer";


var kPPiKadExpiryDate = "iKadExpiryDate.ExpiryDate";


var kPPiKadName = "iKadName.Name";


var kPPiKadNationality = "iKadNationality.Nationality";


var kPPiKadPassportNumber = "iKadPassportNumber.PassportNumber";

/*
Some iKad cards contain sector field, if they don't it won't be returned in the result dictionary.
*/
var kPPiKadSector = "iKadSector.Sector";


var kPPiKadSex = "iKadSex.Sex";
48 changes: 45 additions & 3 deletions www/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,18 @@ var app = {

/**
* Use these scanner types
* Available: "PDF417", "USDL", "Barcode", "MRTD", "EUDL", "UKDL", "DEDL", "MyKad", "GermanOldID", "GermanIDFront", "GermanIDBack", "GermanPassport", "UnitedArabEmiratesIDFront", "UnitedArabEmiratesIDBack", "SingaporeIDFront", "SingaporeIDBack", "DocumentFace", "DocumentDetector"
* Available: "PDF417", "USDL", "Barcode", "MRTD", "EUDL", "UKDL", "DEDL", "MyKadFront", "MyKadBack", "IKad", "MyTentera", "GermanOldID", "GermanIDFront", "GermanIDBack", "GermanPassport", "UnitedArabEmiratesIDFront", "UnitedArabEmiratesIDBack", "SingaporeIDFront", "SingaporeIDBack", "DocumentFace", "DocumentDetector"
* PDF417 - scans PDF417 barcodes
* USDL - scans barcodes located on the back of US driver's license
* Barcode - scans various types of codes (i.e. QR, UPCA, UPCE...). Types of scanned codes can be modified in plugin classes (Explained later in this readme). By default, scanned codes are set to: Code 39, Code 128, EAN 13, EAN 8, QR, UPCA, UPCE
* MRTD - scans Machine Readable Travel Document, contained in various IDs and passports
* EUDL - scans the front side of European driver's license
* UKDL - scans the front side of United Kingom driver's license
* DEDL - scans the front side of German driver's license
* MyKad - scans the front side of Malaysian ID card
* MyKadFront - scans the front side of Malaysian ID card
* MyKadBack - scans the back side of Malaysian ID card
* IKad - scans the front side of IKad card
* MyTentera - scans the front side of Malaysian Tentera card
* GermanOldID - scans the front side of old German ID card
* GermanIDFront - scans the front side of German ID card
* GermanIDBack - scans the back side of German ID card
Expand Down Expand Up @@ -216,7 +219,7 @@ var app = {
"First name: " + fields[kPPeudlFirstName] + "<br>" +
"Last name: " + fields[kPPeudlLastName] + "<br>";

} else if (recognizerResult.resultType == "MyKad result") {
} else if (recognizerResult.resultType == "MyKadFront result") {

resultDiv.innerHTML = /** Personal information */
"ID Type: " + fields[kPPDataType] + "<br>" +
Expand All @@ -231,6 +234,45 @@ var app = {
"Religion: " + fields[kPPmyKadReligion] + "<br>" +
"Sex: " + fields[kPPmyKadSex] + "<br>";

} else if (recognizerResult.resultType == "MyKadBack result") {

resultDiv.innerHTML = /** Personal information */
"ID Type: " + fields[kPPDataType] + "<br>" +
"NRIC Number: " + fields[kPPmyKadBackNricNumber] + "<br>" +
"Extended NRIC Number: " + fields[kPPmyKadBackExtendedNricNumber] + "<br>" +
"Birth Date: " + fields[kPPmyKadBackBirthDate] + "<br>" +
"Sex: " + fields[kPPmyKadBackSex] + "<br>";

} else if (recognizerResult.resultType == "MyTentera result") {

resultDiv.innerHTML = /** Personal information */
"ID Type: " + fields[kPPDataType] + "<br>" +
"Army Number: " + fields[kPPmyTenteraArmyNumber] + "<br>" +
"NRIC Number: " + fields[kPPmyTenteraNricNumber] + "<br>" +
"Address: " + fields[kPPmyTenteraAddress] + "<br>" +
"Address ZIP Code: " + fields[kPPmyTenteraAddressZipCode] + "<br>" +
"Address Street: " + fields[kPPmyTenteraAddressStreet] + "<br>" +
"Address City: " + fields[kPPmyTenteraAddressCity] + "<br>" +
"Address State: " + fields[kPPmyTenteraAddressState] + "<br>" +
"Birth Date: " + fields[kPPmyTenteraBirthDate] + "<br>" +
"Full Name: " + fields[kPPmyTenteraFullName] + "<br>" +
"Religion: " + fields[kPPmyTenteraReligion] + "<br>" +
"Sex: " + fields[kPPmyTenteraSex] + "<br>";

} else if (recognizerResult.resultType == "IKad result") {

resultDiv.innerHTML = /** Personal information */
"ID Type: " + fields[kPPDataType] + "<br>" +
"Address: " + fields[kPPiKadAddress] + "<br>" +
"Birth Date: " + fields[kPPiKadDateOfBirth] + "<br>" +
"Employer: " + fields[kPPiKadEmployer] + "<br>" +
"Expiry Date: " + fields[kPPiKadExpiryDate] + "<br>" +
"Name: " + fields[kPPiKadName] + "<br>" +
"Nationality: " + fields[kPPiKadNationality] + "<br>" +
"Passport Number: " + fields[kPPiKadPassportNumber] + "<br>" +
"Sector: " + fields[kPPiKadSector] + "<br>" +
"Sex: " + fields[kPPiKadSex] + "<br>";

} else if (recognizerResult.resultType == "GermanOldID result") {

resultDiv.innerHTML = /** Personal information */
Expand Down
12 changes: 12 additions & 0 deletions www/js/mykad_keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,15 @@ var kPPmyKadReligion = "ownerReligion";


var kPPmyKadSex = "ownerSex";


var kPPmyKadBackNricNumber = "MyKadExtendedNRIC.NRIC";


var kPPmyKadBackExtendedNricNumber = "MyKadExtendedNRIC.ExtendedNRIC";


var kPPmyKadBackBirthDate = "MyKadExtendedNRIC.DateOfBirth";


var kPPmyKadBackSex = "MyKadExtendedNRIC.Sex";
Loading

0 comments on commit 74446fd

Please sign in to comment.