diff --git a/BlinkID/package.json b/BlinkID/package.json index 020cdf9..1985b2e 100644 --- a/BlinkID/package.json +++ b/BlinkID/package.json @@ -1,6 +1,6 @@ { "name": "blinkid-cordova", - "version": "6.11.1", + "version": "6.12.0", "description": "A small and powerful ID card scanning library", "cordova": { "id": "blinkid-cordova", diff --git a/BlinkID/plugin.xml b/BlinkID/plugin.xml index 01abeb3..9b2e8a4 100644 --- a/BlinkID/plugin.xml +++ b/BlinkID/plugin.xml @@ -2,7 +2,7 @@ + version="6.12.0"> BlinkIdScanner A small and powerful ID card scanning library @@ -153,7 +153,7 @@ - + $CAMERA_USAGE_DESCRIPTION diff --git a/BlinkID/scripts/initIOSFramework.sh b/BlinkID/scripts/initIOSFramework.sh index 06ac1ed..1c58c87 100755 --- a/BlinkID/scripts/initIOSFramework.sh +++ b/BlinkID/scripts/initIOSFramework.sh @@ -4,7 +4,7 @@ HERE="$(dirname "$(test -L "$0" && readlink "$0" || echo "$0")")" pushd "${HERE}/../src/ios/" > /dev/null -LINK='https://github.com/BlinkID/blinkid-ios/releases/download/v6.11.1/BlinkID.xcframework.zip' +LINK='https://github.com/BlinkID/blinkid-ios/releases/download/v6.12.0/BlinkID.xcframework.zip' FILENAME='BlinkID.xcframework.zip' # BlinkID framework will be obtained via wget or curl diff --git a/BlinkID/src/android/java/com/microblink/blinkid/plugins/cordova/overlays/serialization/BlinkIdOverlaySettingsSerialization.java b/BlinkID/src/android/java/com/microblink/blinkid/plugins/cordova/overlays/serialization/BlinkIdOverlaySettingsSerialization.java index b552473..977c297 100644 --- a/BlinkID/src/android/java/com/microblink/blinkid/plugins/cordova/overlays/serialization/BlinkIdOverlaySettingsSerialization.java +++ b/BlinkID/src/android/java/com/microblink/blinkid/plugins/cordova/overlays/serialization/BlinkIdOverlaySettingsSerialization.java @@ -125,6 +125,42 @@ public UISettings createUISettings(Context context, JSONObject jsonUISettings, R if (errorGlareDetected != null) { overlasStringsBuilder.setErrorGlareDetected(errorGlareDetected); } + String topPageInstructions = getStringFromJSONObject(jsonUISettings, "topPageInstructions"); + if (topPageInstructions != null) { + overlasStringsBuilder.setTopPageInstructions(topPageInstructions); + } + String leftPageInstructions = getStringFromJSONObject(jsonUISettings, "leftPageInstructions"); + if (leftPageInstructions != null) { + overlasStringsBuilder.setLeftPageInstructions(leftPageInstructions); + } + String rightPageInstructions = getStringFromJSONObject(jsonUISettings, "rightPageInstructions"); + if (rightPageInstructions != null) { + overlasStringsBuilder.setRightPageInstructions(rightPageInstructions); + } + String turnTopPageInstructions = getStringFromJSONObject(jsonUISettings, "turnTopPageInstructions"); + if (turnTopPageInstructions != null) { + overlasStringsBuilder.setTurnTopPageInstructions(turnTopPageInstructions); + } + String turnLeftPageInstructions = getStringFromJSONObject(jsonUISettings, "turnLeftPageInstructions"); + if (turnLeftPageInstructions != null) { + overlasStringsBuilder.setTurnLeftPageInstructions(turnLeftPageInstructions); + } + String turnRightPageInstructions = getStringFromJSONObject(jsonUISettings, "turnRightPageInstructions"); + if (turnRightPageInstructions != null) { + overlasStringsBuilder.setTurnRightPageInstructions(turnRightPageInstructions); + } + String errorScanningWrongPageTop = getStringFromJSONObject(jsonUISettings, "errorScanningWrongPageTop"); + if (errorScanningWrongPageTop != null) { + overlasStringsBuilder.setErrorScanningWrongPageTop(errorScanningWrongPageTop); + } + String errorScanningWrongPageLeft = getStringFromJSONObject(jsonUISettings, "errorScanningWrongPageLeft"); + if (errorScanningWrongPageLeft != null) { + overlasStringsBuilder.setErrorScanningWrongPageLeft(errorScanningWrongPageLeft); + } + String errorScanningWrongPageRight = getStringFromJSONObject(jsonUISettings, "errorScanningWrongPageRight"); + if (errorScanningWrongPageRight != null) { + overlasStringsBuilder.setErrorScanningWrongPageRight(errorScanningWrongPageRight); + } String language = getStringFromJSONObject(jsonUISettings, "language"); if (language != null) { String country = getStringFromJSONObject(jsonUISettings, "country"); diff --git a/BlinkID/src/android/java/com/microblink/blinkid/plugins/cordova/recognizers/serialization/BlinkIdMultiSideRecognizerSerialization.java b/BlinkID/src/android/java/com/microblink/blinkid/plugins/cordova/recognizers/serialization/BlinkIdMultiSideRecognizerSerialization.java index 213700e..19311b4 100644 --- a/BlinkID/src/android/java/com/microblink/blinkid/plugins/cordova/recognizers/serialization/BlinkIdMultiSideRecognizerSerialization.java +++ b/BlinkID/src/android/java/com/microblink/blinkid/plugins/cordova/recognizers/serialization/BlinkIdMultiSideRecognizerSerialization.java @@ -35,6 +35,7 @@ public Recognizer createRecognizer(JSONObject jsonObject) { recognizer.setReturnSignatureImage(jsonObject.optBoolean("returnSignatureImage", false)); recognizer.setSaveCameraFrames(jsonObject.optBoolean("saveCameraFrames", false)); recognizer.setScanCroppedDocumentImage(jsonObject.optBoolean("scanCroppedDocumentImage", false)); + recognizer.setScanPassportDataPageOnly(jsonObject.optBoolean("scanPassportDataPageOnly", true)); recognizer.setSignatureImageDpi(jsonObject.optInt("signatureImageDpi", 250)); recognizer.setSkipUnsupportedBack(jsonObject.optBoolean("skipUnsupportedBack", false)); recognizer.setValidateResultCharacters(jsonObject.optBoolean("validateResultCharacters", true)); diff --git a/BlinkID/src/android/libBlinkID.gradle b/BlinkID/src/android/libBlinkID.gradle index 5ce59dc..b924a73 100644 --- a/BlinkID/src/android/libBlinkID.gradle +++ b/BlinkID/src/android/libBlinkID.gradle @@ -6,7 +6,7 @@ repositories { } dependencies { - implementation('com.microblink:blinkid:6.11.2@aar') { + implementation('com.microblink:blinkid:6.12.0@aar') { transitive = true } } diff --git a/BlinkID/src/ios/sources/Overlays/Serialization/MBBlinkIdOverlaySettingsSerialization.m b/BlinkID/src/ios/sources/Overlays/Serialization/MBBlinkIdOverlaySettingsSerialization.m index 2a364a5..c224a82 100644 --- a/BlinkID/src/ios/sources/Overlays/Serialization/MBBlinkIdOverlaySettingsSerialization.m +++ b/BlinkID/src/ios/sources/Overlays/Serialization/MBBlinkIdOverlaySettingsSerialization.m @@ -234,6 +234,60 @@ -(MBOverlayViewController *) createOverlayViewController:(NSDictionary *)jsonOve sett.glareDetectedMessage = (NSString *)errorGlareDetected; } } + { + id topPageInstructions = [jsonOverlaySettings valueForKey:@"topPageInstructions"]; + if (topPageInstructions != nil) { + sett.scanTopPageInstructions = (NSString *)topPageInstructions; + } + } + { + id leftPageInstructions = [jsonOverlaySettings valueForKey:@"leftPageInstructions"]; + if (leftPageInstructions != nil) { + sett.scanLeftPageInstructions = (NSString *)leftPageInstructions; + } + } + { + id rightPageInstructions = [jsonOverlaySettings valueForKey:@"rightPageInstructions"]; + if (rightPageInstructions != nil) { + sett.scanRightPageInstructions = (NSString *)rightPageInstructions; + } + } + { + id turnTopPageInstructions = [jsonOverlaySettings valueForKey:@"turnTopPageInstructions"]; + if (turnTopPageInstructions != nil) { + sett.turnTopPageInstructions = (NSString *)turnTopPageInstructions; + } + } + { + id turnLeftPageInstructions = [jsonOverlaySettings valueForKey:@"turnLeftPageInstructions"]; + if (turnLeftPageInstructions != nil) { + sett.turnLeftPageInstructions = (NSString *)turnLeftPageInstructions; + } + } + { + id turnRightPageInstructions = [jsonOverlaySettings valueForKey:@"turnRightPageInstructions"]; + if (turnRightPageInstructions != nil) { + sett.turnRightPageInstructions = (NSString *)turnRightPageInstructions; + } + } + { + id errorScanningWrongPageTop = [jsonOverlaySettings valueForKey:@"errorScanningWrongPageTop"]; + if (errorScanningWrongPageTop != nil) { + sett.scanningWrongSidePassportTopMessage = (NSString *)errorScanningWrongPageTop; + } + } + { + id errorScanningWrongPageLeft = [jsonOverlaySettings valueForKey:@"errorScanningWrongPageLeft"]; + if (errorScanningWrongPageLeft != nil) { + sett.scanningWrongSidePassportLeftMessage = (NSString *)errorScanningWrongPageLeft; + } + } + { + id errorScanningWrongPageRight = [jsonOverlaySettings valueForKey:@"errorScanningWrongPageRight"]; + if (errorScanningWrongPageRight != nil) { + sett.scanningWrongSidePassportRightMessage = (NSString *)errorScanningWrongPageRight; + } + } return [[MBBlinkIdOverlayViewController alloc] initWithSettings:sett recognizerCollection:recognizerCollection delegate:self]; } diff --git a/BlinkID/src/ios/sources/Recognizers/Wrappers/MBBlinkIdMultiSideRecognizerWrapper.m b/BlinkID/src/ios/sources/Recognizers/Wrappers/MBBlinkIdMultiSideRecognizerWrapper.m index 4ee2cbf..726893f 100644 --- a/BlinkID/src/ios/sources/Recognizers/Wrappers/MBBlinkIdMultiSideRecognizerWrapper.m +++ b/BlinkID/src/ios/sources/Recognizers/Wrappers/MBBlinkIdMultiSideRecognizerWrapper.m @@ -163,6 +163,12 @@ -(MBRecognizer *) createRecognizer:(NSDictionary*) jsonRecognizer { recognizer.scanCroppedDocumentImage = [(NSNumber *)scanCroppedDocumentImage boolValue]; } } + { + id scanPassportDataPageOnly = [jsonRecognizer valueForKey:@"scanPassportDataPageOnly"]; + if (scanPassportDataPageOnly != nil) { + recognizer.scanPassportDataPageOnly = [(NSNumber *)scanPassportDataPageOnly boolValue]; + } + } { id signatureImageDpi = [jsonRecognizer valueForKey:@"signatureImageDpi"]; if (signatureImageDpi != nil) { diff --git a/BlinkID/www/blinkIdScanner.js b/BlinkID/www/blinkIdScanner.js index ff7d41c..3f0b14e 100644 --- a/BlinkID/www/blinkIdScanner.js +++ b/BlinkID/www/blinkIdScanner.js @@ -2867,6 +2867,75 @@ function BlinkIdOverlaySettings() { * Default: false */ this.enableAndroidLegacyCameraApi = false; + + /** + * String: Instructions to scan the passport, shown when scanning of the first side is done, before + * scanning the second side of the document. + * + * If null, default value will be used. + */ + this.topPageInstructions = null; + + /** + * String: Instructions to scan the passport, shown when scanning of the first side is done, before scanning the second + * side of the document. + * + * If null, default value will be used. + */ + this.leftPageInstructions = null; + + /** + * String: Instructions to scan the passport, shown when scanning of the first side is done, before scanning the second + * side of the document. + * + * If null, default value will be used. + */ + this.rightPageInstructions = null; + + /** + * String: Instructions to scan the passport, shown when scanning of the first side is done, before scanning the second + * side of the document. + * + * If null, default value will be used. + */ + this.turnTopPageInstructions = null; + + /** + * String: Instructions to scan the passport, shown when scanning of the first side is done, before scanning the second + * side of the document. + * + * If null, default value will be used. + */ + this.turnLeftPageInstructions = null; + + /** + * String: Instructions to scan the passport, shown when scanning of the first side is done, before scanning the second + * side of the document. + * + * If null, default value will be used. + */ + this.turnRightPageInstructions = null; + + /** + * String: Instructions for the user when wrong side of passport is being scanned. + * + * If null, default value will be used. + */ + this.errorScanningWrongPageTop = null; + + /** + * String: Instructions for the user when wrong side of passport is being scanned. + * + * If null, default value will be used. + */ + this.errorScanningWrongPageLeft = null; + + /** + * String: Instructions for the user when wrong side of passport is being scanned. + * + * If null, default value will be used. + */ + this.errorScanningWrongPageRight = null; } BlinkIdOverlaySettings.prototype = new OverlaySettings(); @@ -3459,6 +3528,14 @@ function BlinkIdMultiSideRecognizer() { */ this.scanCroppedDocumentImage = false; + /** + * Scan only the data page ( page containing MRZ ) of the passport. + * If set to `false`, it will be required to scan the second page of certain passports. + * + * + */ + this.scanPassportDataPageOnly = true; + /** * Property for setting DPI for signature images * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception diff --git a/Release notes.md b/Release notes.md index 75c1d4e..09cbf2e 100644 --- a/Release notes.md +++ b/Release notes.md @@ -1,3 +1,21 @@ +## 6.12.0 + +- Updated the plugin to [Android SDK v6.12.0](https://github.com/BlinkID/blinkid-android/releases/tag/v6.12.0) and [iOS SDK v6.12.0](https://github.com/BlinkID/blinkid-ios/releases/tag/v6.12.0) + +**New features** +- **Beta Feature: Second Page Passport Scanning** + - Added support for scanning and extracting data from the second page of passports for select countries - Slovenia, Ireland, and New Zealand. + - When BlinkID detects one of these passports, a UI message will guide the user to the second page. + - By default, this feature is disabled but can be enabled via the `BlinkIdMultiSideRecognizer.scanPassportDataPageOnly` setting - if set to `false`, it will be required to scan the second page of certain passports. This feature is in beta, and your feedback is appreciated. +- USA Green Card - Enabled Data Match for the `Document Number` field, matching values from the VIZ (Visual Inspection Zone) and MRZ to further enhance extraction reliability. + +**Bug fixes** +- Spain ID: Fixed an issue with indefinite expiry dates, ensuring consistent values between the MRZ and Visual Inspection Zone (VIZ). +- Bulgaria ID: Improved parsing for indefinite expiry dates in the MRZ for better accuracy. +- Netherlands ID & Norway Passport: Resolved issues with the `Personal ID number` field that were causing the data match feature to fail. +- Chinese Passport: Enhanced reliability of extracted data with additional logic for the `Document Number` field. +- German ID & Luxembourg ID: Adjusted name extraction logic to resolve issues with name separation, ensuring more consistent results. + ## 6.11.1 - We have updated the plugin to [Android SDK v6.11.2](https://github.com/BlinkID/blinkid-android/releases/tag/v6.11.2) and [iOS SDK v6.11.1](https://github.com/BlinkID/blinkid-ios/releases/tag/v6.11.1) diff --git a/initCordovaSampleApp.sh b/initCordovaSampleApp.sh index 8825a1b..45e4fa7 100755 --- a/initCordovaSampleApp.sh +++ b/initCordovaSampleApp.sh @@ -41,7 +41,10 @@ cordova prepare # how to run echo "To run iOS demo application: -1. Open Xcode project $APP_NAME/platforms/ios/$APP_NAME.xcodeproj +1. Open Xcode project in the following path: $APP_NAME/platforms/ios/$APP_NAME.xcodeproj 2. Add the NSPhotoLibraryUsageDescription key to Info.plist if DirectAPI will be used 3. Set your development team." -echo "To run Android demo application, position to $APP_NAME folder and type: cordova run android" +echo "" +echo "To run Android demo application: +1. Position to the $APP_NAME folder +2. Run the command: cordova run android" diff --git a/sample_files/www/js/index.js b/sample_files/www/js/index.js index 21c2af9..1e2beb0 100644 --- a/sample_files/www/js/index.js +++ b/sample_files/www/js/index.js @@ -75,8 +75,8 @@ var app = { // package name/bundleID com.microblink.sample var licenseKeys = { - android: 'sRwCABVjb20ubWljcm9ibGluay5zYW1wbGUAbGV5SkRjbVZoZEdWa1QyNGlPakUzTWprMk56STFOemt5TlRZc0lrTnlaV0YwWldSR2IzSWlPaUprWkdRd05qWmxaaTAxT0RJekxUUXdNRGd0T1RRNE1DMDFORFU0WWpBeFlUVTJZamdpZlE9PcrAOSeJRWm8NpTScxgcudqfZAkJmFrFr6acjOpEO99vEkqAQpfhPkpGzPHlR73WkYjLL9NmiCAChWAzur4NI0t26FrnVqr/1NZes61Q4iCKi9leea2ygLf1wzLGRw8V/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ildResult(result, key) {