From 95d56d38019cb29bcaa5b20499f825362c37feec Mon Sep 17 00:00:00 2001 From: Ivan Grce Date: Wed, 18 Mar 2020 15:16:27 +0100 Subject: [PATCH 1/6] [android] updated bindings for v5.3.0 --- BlinkID/plugin.xml | 1 + .../BlinkIdOverlaySettingsSerialization.java | 66 +- ...ificationOverlaySettingsSerialization.java | 10 +- .../recognizers/RecognizerSerializers.java | 1 + ...linkIdCombinedRecognizerSerialization.java | 3 + .../BlinkIdRecognizerSerialization.java | 3 + .../IdBarcodeRecognizerSerialization.java | 66 ++ .../serialization/SerializationUtils.java | 8 + BlinkID/src/android/libBlinkID.gradle | 2 +- BlinkID/www/blinkIdScanner.js | 620 +++++++++++------- 10 files changed, 520 insertions(+), 260 deletions(-) create mode 100644 BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/IdBarcodeRecognizerSerialization.java diff --git a/BlinkID/plugin.xml b/BlinkID/plugin.xml index a300fc5..1721cb9 100644 --- a/BlinkID/plugin.xml +++ b/BlinkID/plugin.xml @@ -68,6 +68,7 @@ + diff --git a/BlinkID/src/android/java/com/phonegap/plugins/microblink/overlays/serialization/BlinkIdOverlaySettingsSerialization.java b/BlinkID/src/android/java/com/phonegap/plugins/microblink/overlays/serialization/BlinkIdOverlaySettingsSerialization.java index f750a39..808a228 100644 --- a/BlinkID/src/android/java/com/phonegap/plugins/microblink/overlays/serialization/BlinkIdOverlaySettingsSerialization.java +++ b/BlinkID/src/android/java/com/phonegap/plugins/microblink/overlays/serialization/BlinkIdOverlaySettingsSerialization.java @@ -3,17 +3,79 @@ import android.content.Context; import com.microblink.entities.recognizers.RecognizerBundle; +import com.microblink.fragment.overlay.blinkid.reticleui.ReticleOverlayStrings; import com.microblink.uisettings.BlinkIdUISettings; import com.microblink.uisettings.UISettings; import com.phonegap.plugins.microblink.overlays.OverlaySettingsSerialization; import org.json.JSONObject; +import static com.phonegap.plugins.microblink.recognizers.serialization.SerializationUtils.getStringFromJSONObject; + public final class BlinkIdOverlaySettingsSerialization implements OverlaySettingsSerialization { @Override public UISettings createUISettings(Context context, JSONObject jsonUISettings, RecognizerBundle recognizerBundle) { - // no settings deserialized at the moment - return new BlinkIdUISettings(recognizerBundle); + BlinkIdUISettings settings = new BlinkIdUISettings(recognizerBundle); + + boolean requireDocumentSidesDataMatch = jsonUISettings.optBoolean("requireDocumentSidesDataMatch", true); + settings.setDocumentDataMatchRequired(requireDocumentSidesDataMatch); + + boolean showNotSupportedDialog = jsonUISettings.optBoolean("showNotSupportedDialog", true); + settings.setShowNotSupportedDialog(showNotSupportedDialog); + + long backSideScanningTimeoutMiliseconds = jsonUISettings.optLong("backSideScanningTimeoutMilliseconds", 17_00); + settings.setBackSideScanningTimeoutMs(backSideScanningTimeoutMiliseconds); + + ReticleOverlayStrings.Builder overlasStringsBuilder = new ReticleOverlayStrings.Builder(context); + + String firstSideInstructionsText = getStringFromJSONObject(jsonUISettings, "firstSideInstructionsText"); + if (firstSideInstructionsText != null) { + overlasStringsBuilder.setFirstSideInstructionsText(firstSideInstructionsText); + } + String flipInstructions = getStringFromJSONObject(jsonUISettings, "flipInstructions"); + if (flipInstructions != null) { + overlasStringsBuilder.setFlipInstructions(flipInstructions); + } + String errorMoveCloser = getStringFromJSONObject(jsonUISettings, "errorMoveCloser"); + if (errorMoveCloser != null) { + overlasStringsBuilder.setErrorMoveCloser(errorMoveCloser); + } + String errorMoveFarther = getStringFromJSONObject(jsonUISettings, "errorMoveFarther"); + if (errorMoveFarther != null) { + overlasStringsBuilder.setErrorMoveFarther(errorMoveFarther); + } + String sidesNotMatchingTitle = getStringFromJSONObject(jsonUISettings, "sidesNotMatchingTitle"); + if (sidesNotMatchingTitle != null) { + overlasStringsBuilder.setSidesNotMatchingTitle(sidesNotMatchingTitle); + } + String sidesNotMatchingMessage = getStringFromJSONObject(jsonUISettings, "sidesNotMatchingMessage"); + if (sidesNotMatchingMessage != null) { + overlasStringsBuilder.setSidesNotMatchingMessage(sidesNotMatchingMessage); + } + String unsupportedDocumentTitle = getStringFromJSONObject(jsonUISettings, "unsupportedDocumentTitle"); + if (unsupportedDocumentTitle != null) { + overlasStringsBuilder.setUnsupportedDocumentTitle(unsupportedDocumentTitle); + } + String unsupportedDocumentMessage = getStringFromJSONObject(jsonUISettings, "unsupportedDocumentMessage"); + if (unsupportedDocumentMessage != null) { + overlasStringsBuilder.setUnsupportedDocumentMessage(unsupportedDocumentMessage); + } + String recognitionTimeoutTitle = getStringFromJSONObject(jsonUISettings, "recognitionTimeoutTitle"); + if (recognitionTimeoutTitle != null) { + overlasStringsBuilder.setRecognitionTimeoutTitle(recognitionTimeoutTitle); + } + String recognitionTimeoutMessage = getStringFromJSONObject(jsonUISettings, "recognitionTimeoutMessage"); + if (recognitionTimeoutMessage != null) { + overlasStringsBuilder.setRecognitionTimeoutMessage(recognitionTimeoutMessage); + } + String retryButtonText = getStringFromJSONObject(jsonUISettings, "retryButtonText"); + if (retryButtonText != null) { + overlasStringsBuilder.setRetryButtonText(retryButtonText); + } + + settings.setStrings(overlasStringsBuilder.build()); + + return settings; } @Override diff --git a/BlinkID/src/android/java/com/phonegap/plugins/microblink/overlays/serialization/DocumentVerificationOverlaySettingsSerialization.java b/BlinkID/src/android/java/com/phonegap/plugins/microblink/overlays/serialization/DocumentVerificationOverlaySettingsSerialization.java index 05fb9ed..cc7fc00 100644 --- a/BlinkID/src/android/java/com/phonegap/plugins/microblink/overlays/serialization/DocumentVerificationOverlaySettingsSerialization.java +++ b/BlinkID/src/android/java/com/phonegap/plugins/microblink/overlays/serialization/DocumentVerificationOverlaySettingsSerialization.java @@ -10,6 +10,8 @@ import org.json.JSONObject; +import static com.phonegap.plugins.microblink.recognizers.serialization.SerializationUtils.getStringFromJSONObject; + public final class DocumentVerificationOverlaySettingsSerialization implements OverlaySettingsSerialization { @Override public UISettings createUISettings(Context context, JSONObject jsonUISettings, RecognizerBundle recognizerBundle) { @@ -41,14 +43,6 @@ public UISettings createUISettings(Context context, JSONObject jsonUISettings, R return settings; } - private String getStringFromJSONObject(JSONObject map, String key) { - String value = map.optString(key, null); - if ("null".equals(value)) { - value = null; - } - return value; - } - @Override public String getJsonName() { return "DocumentVerificationOverlaySettings"; diff --git a/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/RecognizerSerializers.java b/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/RecognizerSerializers.java index 48f5092..01273ed 100644 --- a/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/RecognizerSerializers.java +++ b/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/RecognizerSerializers.java @@ -26,6 +26,7 @@ private void registerMapping( RecognizerSerialization recognizerSerialization ) registerMapping(new BlinkIdCombinedRecognizerSerialization()); registerMapping(new BlinkIdRecognizerSerialization()); registerMapping(new DocumentFaceRecognizerSerialization()); + registerMapping(new IdBarcodeRecognizerSerialization()); registerMapping(new MrtdCombinedRecognizerSerialization()); registerMapping(new MrtdRecognizerSerialization()); registerMapping(new PassportRecognizerSerialization()); diff --git a/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/BlinkIdCombinedRecognizerSerialization.java b/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/BlinkIdCombinedRecognizerSerialization.java index e436473..8e9bb72 100644 --- a/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/BlinkIdCombinedRecognizerSerialization.java +++ b/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/BlinkIdCombinedRecognizerSerialization.java @@ -12,6 +12,8 @@ public final class BlinkIdCombinedRecognizerSerialization implements RecognizerS public Recognizer createRecognizer(JSONObject jsonRecognizer) { com.microblink.entities.recognizers.blinkid.generic.BlinkIdCombinedRecognizer recognizer = new com.microblink.entities.recognizers.blinkid.generic.BlinkIdCombinedRecognizer(); recognizer.setAllowBlurFilter(jsonRecognizer.optBoolean("allowBlurFilter", true)); + recognizer.setAllowUnparsedMrzResults(jsonRecognizer.optBoolean("allowUnparsedMrzResults", false)); + recognizer.setAllowUnverifiedMrzResults(jsonRecognizer.optBoolean("allowUnverifiedMrzResults", true)); recognizer.setFaceImageDpi(jsonRecognizer.optInt("faceImageDpi", 250)); recognizer.setFullDocumentImageDpi(jsonRecognizer.optInt("fullDocumentImageDpi", 250)); recognizer.setFullDocumentImageExtensionFactors(BlinkIDSerializationUtils.deserializeExtensionFactors(jsonRecognizer.optJSONObject("fullDocumentImageExtensionFactors"))); @@ -33,6 +35,7 @@ public JSONObject serializeResult(Recognizer recognizer) { jsonResult.put("conditions", result.getConditions()); jsonResult.put("dateOfBirth", SerializationUtils.serializeDate(result.getDateOfBirth())); jsonResult.put("dateOfExpiry", SerializationUtils.serializeDate(result.getDateOfExpiry())); + jsonResult.put("dateOfExpiryPermanent", result.isDateOfExpiryPermanent()); jsonResult.put("dateOfIssue", SerializationUtils.serializeDate(result.getDateOfIssue())); jsonResult.put("digitalSignature", SerializationUtils.encodeByteArrayToBase64(result.getDigitalSignature())); jsonResult.put("digitalSignatureVersion", (int)result.getDigitalSignatureVersion()); diff --git a/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/BlinkIdRecognizerSerialization.java b/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/BlinkIdRecognizerSerialization.java index d264bc8..816a042 100644 --- a/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/BlinkIdRecognizerSerialization.java +++ b/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/BlinkIdRecognizerSerialization.java @@ -12,6 +12,8 @@ public final class BlinkIdRecognizerSerialization implements RecognizerSerializa public Recognizer createRecognizer(JSONObject jsonRecognizer) { com.microblink.entities.recognizers.blinkid.generic.BlinkIdRecognizer recognizer = new com.microblink.entities.recognizers.blinkid.generic.BlinkIdRecognizer(); recognizer.setAllowBlurFilter(jsonRecognizer.optBoolean("allowBlurFilter", true)); + recognizer.setAllowUnparsedMrzResults(jsonRecognizer.optBoolean("allowUnparsedMrzResults", false)); + recognizer.setAllowUnverifiedMrzResults(jsonRecognizer.optBoolean("allowUnverifiedMrzResults", true)); recognizer.setFaceImageDpi(jsonRecognizer.optInt("faceImageDpi", 250)); recognizer.setFullDocumentImageDpi(jsonRecognizer.optInt("fullDocumentImageDpi", 250)); recognizer.setFullDocumentImageExtensionFactors(BlinkIDSerializationUtils.deserializeExtensionFactors(jsonRecognizer.optJSONObject("fullDocumentImageExtensionFactors"))); @@ -32,6 +34,7 @@ public JSONObject serializeResult(Recognizer recognizer) { jsonResult.put("conditions", result.getConditions()); jsonResult.put("dateOfBirth", SerializationUtils.serializeDate(result.getDateOfBirth())); jsonResult.put("dateOfExpiry", SerializationUtils.serializeDate(result.getDateOfExpiry())); + jsonResult.put("dateOfExpiryPermanent", result.isDateOfExpiryPermanent()); jsonResult.put("dateOfIssue", SerializationUtils.serializeDate(result.getDateOfIssue())); jsonResult.put("documentAdditionalNumber", result.getDocumentAdditionalNumber()); jsonResult.put("documentNumber", result.getDocumentNumber()); diff --git a/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/IdBarcodeRecognizerSerialization.java b/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/IdBarcodeRecognizerSerialization.java new file mode 100644 index 0000000..1f991b0 --- /dev/null +++ b/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/IdBarcodeRecognizerSerialization.java @@ -0,0 +1,66 @@ +package com.phonegap.plugins.microblink.recognizers.serialization; + +import com.microblink.entities.recognizers.Recognizer; +import com.phonegap.plugins.microblink.recognizers.RecognizerSerialization; + +import org.json.JSONException; +import org.json.JSONObject; + +public final class IdBarcodeRecognizerSerialization implements RecognizerSerialization { + + @Override + public Recognizer createRecognizer(JSONObject jsonRecognizer) { + com.microblink.entities.recognizers.blinkid.idbarcode.IdBarcodeRecognizer recognizer = new com.microblink.entities.recognizers.blinkid.idbarcode.IdBarcodeRecognizer(); + return recognizer; + } + + @Override + public JSONObject serializeResult(Recognizer recognizer) { + com.microblink.entities.recognizers.blinkid.idbarcode.IdBarcodeRecognizer.Result result = ((com.microblink.entities.recognizers.blinkid.idbarcode.IdBarcodeRecognizer)recognizer).getResult(); + JSONObject jsonResult = new JSONObject(); + try { + SerializationUtils.addCommonResultData(jsonResult, result); + jsonResult.put("additionalAddressInformation", result.getAdditionalAddressInformation()); + jsonResult.put("additionalNameInformation", result.getAdditionalNameInformation()); + jsonResult.put("address", result.getAddress()); + jsonResult.put("barcodeType", SerializationUtils.serializeEnum(result.getBarcodeType())); + jsonResult.put("dateOfBirth", SerializationUtils.serializeDate(result.getDateOfBirth())); + jsonResult.put("dateOfExpiry", SerializationUtils.serializeDate(result.getDateOfExpiry())); + jsonResult.put("dateOfIssue", SerializationUtils.serializeDate(result.getDateOfIssue())); + jsonResult.put("documentAdditionalNumber", result.getDocumentAdditionalNumber()); + jsonResult.put("documentNumber", result.getDocumentNumber()); + jsonResult.put("documentType", SerializationUtils.serializeEnum(result.getDocumentType())); + jsonResult.put("employer", result.getEmployer()); + jsonResult.put("firstName", result.getFirstName()); + jsonResult.put("fullName", result.getFullName()); + jsonResult.put("issuingAuthority", result.getIssuingAuthority()); + jsonResult.put("lastName", result.getLastName()); + jsonResult.put("maritalStatus", result.getMaritalStatus()); + jsonResult.put("nationality", result.getNationality()); + jsonResult.put("personalIdNumber", result.getPersonalIdNumber()); + jsonResult.put("placeOfBirth", result.getPlaceOfBirth()); + jsonResult.put("profession", result.getProfession()); + jsonResult.put("race", result.getRace()); + jsonResult.put("rawData", SerializationUtils.encodeByteArrayToBase64(result.getRawData())); + jsonResult.put("religion", result.getReligion()); + jsonResult.put("residentialStatus", result.getResidentialStatus()); + jsonResult.put("sex", result.getSex()); + jsonResult.put("stringData", result.getStringData()); + jsonResult.put("uncertain", result.isUncertain()); + } catch (JSONException e) { + // see https://developer.android.com/reference/org/json/JSONException + throw new RuntimeException(e); + } + return jsonResult; + } + + @Override + public String getJsonName() { + return "IdBarcodeRecognizer"; + } + + @Override + public Class getRecognizerClass() { + return com.microblink.entities.recognizers.blinkid.idbarcode.IdBarcodeRecognizer.class; + } +} \ No newline at end of file diff --git a/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/SerializationUtils.java b/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/SerializationUtils.java index c6eaebd..57e4603 100644 --- a/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/SerializationUtils.java +++ b/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/SerializationUtils.java @@ -100,4 +100,12 @@ public static JSONObject serializeQuad(Quadrilateral quad) throws JSONException jsonQuad.put("lowerRight", serializePoint(quad.getLowerRight())); return jsonQuad; } + + public static String getStringFromJSONObject(JSONObject map, String key) { + String value = map.optString(key, null); + if ("null".equals(value)) { + value = null; + } + return value; + } } diff --git a/BlinkID/src/android/libBlinkID.gradle b/BlinkID/src/android/libBlinkID.gradle index 03f686f..bef4ccc 100644 --- a/BlinkID/src/android/libBlinkID.gradle +++ b/BlinkID/src/android/libBlinkID.gradle @@ -5,7 +5,7 @@ repositories { } dependencies { - implementation('com.microblink:blinkid:5.2.0@aar') { + implementation('com.microblink:blinkid:5.3.0@aar') { transitive = true } } diff --git a/BlinkID/www/blinkIdScanner.js b/BlinkID/www/blinkIdScanner.js index 2f1d813..56260ac 100644 --- a/BlinkID/www/blinkIdScanner.js +++ b/BlinkID/www/blinkIdScanner.js @@ -215,6 +215,34 @@ BlinkID.prototype.MrtdDocumentType = Object.freeze( } ); +/** + * Possible types of documents scanned with IdBarcodeRecognizer. + */ +BlinkID.prototype.IdBarcodeDocumentType = Object.freeze( + { + /** No document was scanned */ + None: 1, + /** AAMVACompliant document was scanned */ + AAMVACompliant: 2, + /** Argentina ID document was scanned */ + ArgentinaID: 3, + /** Argentina driver license document was scanned */ + ArgentinaDL: 4, + /** Colombia ID document was scanned */ + ColombiaID: 5, + /** Colombia driver license document was scanned */ + ColombiaDL: 6, + /** NigeriaVoter ID document was scanned */ + NigeriaVoterID: 7, + /** Nigeria driver license document was scanned */ + NigeriaDL: 8, + /** Panama ID document was scanned */ + PanamaID: 9, + /** SouthAfrica ID document was scanned */ + SouthAfricaID: 10 + } +); + /** * Represents data extracted from MRZ (Machine Readable Zone) of Machine Readable Travel Document (MRTD). */ @@ -455,6 +483,82 @@ BlinkID.prototype.DocumentVerificationOverlaySettings = DocumentVerificationOver */ function BlinkIdOverlaySettings() { OverlaySettings.call(this, 'BlinkIdOverlaySettings'); + /** + * String: message that is shown while scanning first side of the document. + * If null, default value will be used. + */ + this.firstSideInstructionsText = null; + /** + * String: instructions to flip document, 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.flipInstructions = null; + /** + * String: instructions for the user to move the document closer. + * If null, default value will be used. + */ + this.errorMoveCloser = null; + /** + * String: instructions for the user to move the document farther. + * If null, default value will be used. + */ + this.errorMoveFarther = null; + /** + * String: title of the dialog, which is shown when scanned document sides are not from the same document. + * If null, default value will be used. + */ + this.sidesNotMatchingTitle = null; + /** + * String: message inside dialog, which is shown when scanned document sides are not from the same document. + * If null, default value will be used. + */ + this.sidesNotMatchingMessage = null; + /** + * String: title of the dialog, which is shown when unsupported document is scanned. + * If null, default value will be used. + */ + this.unsupportedDocumentTitle = null; + /** + * String: message inside dialog, which is shown when unsupported document is scanned. + * If null, default value will be used. + */ + this.unsupportedDocumentMessage = null; + /** + * String: title of the dialog, which is shown on timeout when scanning is stuck on the back document side. + * If null, default value will be used. + */ + this.recognitionTimeoutTitle = null; + /** + * String: message inside dialog, which is shown on timeout when scanning is stuck on the back document side. + * If null, default value will be used. + */ + this.recognitionTimeoutMessage = null; + /** + * String: text of the "retry" button inside dialog, which is shown on timeout when scanning is stuck on the back + * document side. + */ + this.retryButtonText = null; + + /** + * If true, BlinkIdCombinedRecognizer will check if sides do match when scanning is finished + * Default: true + */ + this.requireDocumentSidesDataMatch = true; + + /** + * Defines whether Document Not Supported dialog will be displayed in UI. + * + * Default: true + */ + this.showNotSupportedDialog = true; + + /** + * Option to configure back side scanning timeout. + * + * Default: 17000 + */ + this.backSideScanningTimeoutMilliseconds = 17000; } BlinkIdOverlaySettings.prototype = new OverlaySettings(); @@ -506,7 +610,7 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * The additional address information of the document owner. + * The additional name information of the document owner. */ this.additionalAddressInformation = nativeResult.additionalAddressInformation; @@ -535,18 +639,23 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { */ this.dateOfExpiry = nativeResult.dateOfExpiry != null ? new Date(nativeResult.dateOfExpiry) : null; + /** + * Determines if date of expiry is permanent. + */ + this.dateOfExpiryPermanent = nativeResult.dateOfExpiryPermanent; + /** * The date of issue of the document. */ this.dateOfIssue = nativeResult.dateOfIssue != null ? new Date(nativeResult.dateOfIssue) : null; /** - * Digital signature of the recognition result. Available only if enabled with signResult property. + * Defines digital signature of recognition results. */ this.digitalSignature = nativeResult.digitalSignature; /** - * Version of the digital signature. Available only if enabled with signResult property. + * Defines digital signature version. */ this.digitalSignatureVersion = nativeResult.digitalSignatureVersion; @@ -556,10 +665,7 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.documentAdditionalNumber = nativeResult.documentAdditionalNumber; /** - * Returns DataMatchResultSuccess if data from scanned parts/sides of the document match, - * DataMatchResultFailed otherwise. For example if date of expiry is scanned from the front and back side - * of the document and values do not match, this method will return DataMatchResultFailed. Result will - * be DataMatchResultSuccess only if scanned values for all fields that are compared are the same. + * Defines result of the data matching algorithm for scanned parts/sides of the document. */ this.documentDataMatch = nativeResult.documentDataMatch; @@ -579,7 +685,7 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.employer = nativeResult.employer; /** - * face image from the document if enabled with returnFaceImage property. + * Face image from the document */ this.faceImage = nativeResult.faceImage; @@ -589,12 +695,12 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.firstName = nativeResult.firstName; /** - * back side image of the document if enabled with returnFullDocumentImage property. + * Back side image of the document */ this.fullDocumentBackImage = nativeResult.fullDocumentBackImage; /** - * front side image of the document if enabled with returnFullDocumentImage property. + * Front side image of the document */ this.fullDocumentFrontImage = nativeResult.fullDocumentFrontImage; @@ -624,7 +730,7 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.maritalStatus = nativeResult.maritalStatus; /** - * The data extracted from the machine readable zone + * The data extracted from the machine readable zone. */ this.mrzResult = nativeResult.mrzResult != null ? new MrzResult(nativeResult.mrzResult) : null; @@ -664,8 +770,7 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.residentialStatus = nativeResult.residentialStatus; /** - * Returns true if recognizer has finished scanning first side and is now scanning back side, - * false if it's still scanning first side. + * {true} if recognizer has finished scanning first side and is now scanning back side, */ this.scanningFirstSideDone = nativeResult.scanningFirstSideDone; @@ -681,70 +786,53 @@ BlinkIdCombinedRecognizerResult.prototype = new RecognizerResult(RecognizerResul BlinkID.prototype.BlinkIdCombinedRecognizerResult = BlinkIdCombinedRecognizerResult; /** - * Recognizer which can scan front and back side of the United States driver license. + * A generic recognizer which can scan front and back side of the document. */ function BlinkIdCombinedRecognizer() { Recognizer.call(this, 'BlinkIdCombinedRecognizer'); /** - * Defines whether blured frames filtering is allowed - * - * + * Defines whether blured frames filtering is allowed. */ this.allowBlurFilter = true; /** - * Document not supported classifier delegate + * Defines whether returning of unparsed MRZ (Machine Readable Zone) results is allowed. */ - this.classifierDelegate = null; + this.allowUnparsedMrzResults = false; /** - * Full document dewarped imagedelegate + * Defines whether returning unverified MRZ (Machine Readable Zone) results is allowed. */ - this.dewarpedImageDelegate = null; + this.allowUnverifiedMrzResults = true; /** - * Property for setting DPI for face images - * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * The DPI (Dots Per Inch) for face image that should be returned. */ this.faceImageDpi = 250; /** - * Property for setting DPI for full document images - * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * The DPI (Dots Per Inch) for full document image that should be returned. */ this.fullDocumentImageDpi = 250; /** - * Image extension factors for full document image. - * - * @see ImageExtensionFactors - * + * The extension factors for full document image. */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** - * Sets whether face image from ID card should be extracted - * - * + * Defines whether face image will be available in result. */ this.returnFaceImage = false; /** - * Sets whether full document image of ID card should be extracted. - * - * + * Defines whether full document image will be available in */ this.returnFullDocumentImage = false; /** - * Whether or not recognition result should be signed. - * - * + * Defines whether or not recognition result should be signed. */ this.signResult = false; @@ -763,7 +851,7 @@ function BlinkIdRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * The additional address information of the document owner. + * The additional name information of the document owner. */ this.additionalAddressInformation = nativeResult.additionalAddressInformation; @@ -792,6 +880,11 @@ function BlinkIdRecognizerResult(nativeResult) { */ this.dateOfExpiry = nativeResult.dateOfExpiry != null ? new Date(nativeResult.dateOfExpiry) : null; + /** + * Determines if date of expiry is permanent. + */ + this.dateOfExpiryPermanent = nativeResult.dateOfExpiryPermanent; + /** * The date of issue of the document. */ @@ -818,7 +911,7 @@ function BlinkIdRecognizerResult(nativeResult) { this.employer = nativeResult.employer; /** - * face image from the document if enabled with returnFaceImage property. + * Face image from the document */ this.faceImage = nativeResult.faceImage; @@ -828,7 +921,7 @@ function BlinkIdRecognizerResult(nativeResult) { this.firstName = nativeResult.firstName; /** - * full document image if enabled with returnFullDocumentImage property. + * Image of the full document */ this.fullDocumentImage = nativeResult.fullDocumentImage; @@ -858,7 +951,7 @@ function BlinkIdRecognizerResult(nativeResult) { this.maritalStatus = nativeResult.maritalStatus; /** - * The data extracted from the machine readable zone + * The data extracted from the machine readable zone. */ this.mrzResult = nativeResult.mrzResult != null ? new MrzResult(nativeResult.mrzResult) : null; @@ -909,63 +1002,48 @@ BlinkIdRecognizerResult.prototype = new RecognizerResult(RecognizerResultState.e BlinkID.prototype.BlinkIdRecognizerResult = BlinkIdRecognizerResult; /** - * The Blink ID Recognizer is used for scanning Blink ID. + * Generic BlinkID recognizer. */ function BlinkIdRecognizer() { Recognizer.call(this, 'BlinkIdRecognizer'); /** - * Defines whether blured frames filtering is allowed - * - * + * Defines whether blured frames filtering is allowed" */ this.allowBlurFilter = true; /** - * Document not supported classifier delegate + * Defines whether returning of unparsed MRZ (Machine Readable Zone) results is allowed. */ - this.classifierDelegate = null; + this.allowUnparsedMrzResults = false; /** - * Full document dewarped imagedelegate + * Defines whether returning unverified MRZ (Machine Readable Zone) results is allowed. */ - this.dewarpedImageDelegate = null; + this.allowUnverifiedMrzResults = true; /** - * Property for setting DPI for face images - * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * The DPI (Dots Per Inch) for face image that should be returned. */ this.faceImageDpi = 250; /** - * Property for setting DPI for full document images - * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * The DPI (Dots Per Inch) for full document image that should be returned. */ this.fullDocumentImageDpi = 250; /** - * Image extension factors for full document image. - * - * @see ImageExtensionFactors - * + * The extension factors for full document image. */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** - * Sets whether face image from ID card should be extracted - * - * + * Defines whether face image will be available in result. */ this.returnFaceImage = false; /** - * Sets whether full document image of ID card should be extracted. - * - * + * Defines whether full document image will be available in */ this.returnFullDocumentImage = false; @@ -984,22 +1062,22 @@ function DocumentFaceRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * Quadrangle represeting corner points of the document within the input image. + * The location of document detection in coordinate system of full input frame. */ this.documentLocation = nativeResult.documentLocation != null ? new Quadrilateral(nativeResult.documentLocation) : null; /** - * face image from the document if enabled with returnFaceImage property. + * Face image from the document */ this.faceImage = nativeResult.faceImage; /** - * Quadrangle represeting corner points of the face image within the input image. + * The location of face detection in coordinate system of cropped full document image. */ this.faceLocation = nativeResult.faceLocation != null ? new Quadrilateral(nativeResult.faceLocation) : null; /** - * full document image if enabled with returnFullDocumentImage property. + * Image of the full document */ this.fullDocumentImage = nativeResult.fullDocumentImage; @@ -1010,65 +1088,43 @@ DocumentFaceRecognizerResult.prototype = new RecognizerResult(RecognizerResultSt BlinkID.prototype.DocumentFaceRecognizerResult = DocumentFaceRecognizerResult; /** - * Class for configuring Document Face Recognizer Recognizer. - * - * Document Face Recognizer recognizer is used for scanning documents containing face images. + * Recognizer for detecting holder's photo on documents containing image. */ function DocumentFaceRecognizer() { Recognizer.call(this, 'DocumentFaceRecognizer'); /** - * Type of docment this recognizer will scan. - * - * + * Currently used detector type. */ this.detectorType = DocumentFaceDetectorType.TD1; /** - * Property for setting DPI for face images - * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * The DPI (Dots Per Inch) for face image that should be returned. */ this.faceImageDpi = 250; /** - * Property for setting DPI for full document images - * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * The DPI (Dots Per Inch) for full document image that should be returned. */ this.fullDocumentImageDpi = 250; /** - * Image extension factors for full document image. - * - * @see ImageExtensionFactors - * + * The extension factors for full document image. */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** - * Defines how many times the same document should be detected before the detector - * returns this document as a result of the deteciton - * - * Higher number means more reliable detection, but slower processing - * - * + * Minimum number of stable detections required for detection to be successful. */ this.numStableDetectionsThreshold = 6; /** - * Sets whether face image from ID card should be extracted - * - * + * Defines whether face image will be available in result. */ this.returnFaceImage = false; /** - * Sets whether full document image of ID card should be extracted. - * - * + * Defines whether full document image will be available in */ this.returnFullDocumentImage = false; @@ -1080,6 +1136,167 @@ DocumentFaceRecognizer.prototype = new Recognizer('DocumentFaceRecognizer'); BlinkID.prototype.DocumentFaceRecognizer = DocumentFaceRecognizer; +/** + * Result object for IdBarcodeRecognizer. + */ +function IdBarcodeRecognizerResult(nativeResult) { + RecognizerResult.call(this, nativeResult.resultState); + + /** + * THe additional address information of the document owner. + */ + this.additionalAddressInformation = nativeResult.additionalAddressInformation; + + /** + * The additional name information of the document owner. + */ + this.additionalNameInformation = nativeResult.additionalNameInformation; + + /** + * The address of the document owner. + */ + this.address = nativeResult.address; + + /** + * The format of the scanned barcode. + */ + this.barcodeType = nativeResult.barcodeType; + + /** + * The date of birth of the document owner. + */ + this.dateOfBirth = nativeResult.dateOfBirth != null ? new Date(nativeResult.dateOfBirth) : null; + + /** + * The date of expiry of the document. + */ + this.dateOfExpiry = nativeResult.dateOfExpiry != null ? new Date(nativeResult.dateOfExpiry) : null; + + /** + * The date of issue of the document. + */ + this.dateOfIssue = nativeResult.dateOfIssue != null ? new Date(nativeResult.dateOfIssue) : null; + + /** + * The additional number of the document. + */ + this.documentAdditionalNumber = nativeResult.documentAdditionalNumber; + + /** + * The document number. + */ + this.documentNumber = nativeResult.documentNumber; + + /** + * The document type deduced from the recognized barcode + */ + this.documentType = nativeResult.documentType; + + /** + * The employer of the document owner. + */ + this.employer = nativeResult.employer; + + /** + * The first name of the document owner. + */ + this.firstName = nativeResult.firstName; + + /** + * The full name of the document owner. + */ + this.fullName = nativeResult.fullName; + + /** + * The issuing authority of the document. + */ + this.issuingAuthority = nativeResult.issuingAuthority; + + /** + * The last name of the document owner. + */ + this.lastName = nativeResult.lastName; + + /** + * The marital status of the document owner. + */ + this.maritalStatus = nativeResult.maritalStatus; + + /** + * The nationality of the documet owner. + */ + this.nationality = nativeResult.nationality; + + /** + * The personal identification number. + */ + this.personalIdNumber = nativeResult.personalIdNumber; + + /** + * The place of birth of the document owner. + */ + this.placeOfBirth = nativeResult.placeOfBirth; + + /** + * The profession of the document owner. + */ + this.profession = nativeResult.profession; + + /** + * The race of the document owner. + */ + this.race = nativeResult.race; + + /** + * The raw bytes contained inside barcode. + */ + this.rawData = nativeResult.rawData; + + /** + * The religion of the document owner. + */ + this.religion = nativeResult.religion; + + /** + * The residential stauts of the document owner. + */ + this.residentialStatus = nativeResult.residentialStatus; + + /** + * The sex of the document owner. + */ + this.sex = nativeResult.sex; + + /** + * String representation of data inside barcode. + */ + this.stringData = nativeResult.stringData; + + /** + * True if returned result is uncertain, i.e. if scanned barcode was incomplete (i.e. + */ + this.uncertain = nativeResult.uncertain; + +} + +IdBarcodeRecognizerResult.prototype = new RecognizerResult(RecognizerResultState.empty); + +BlinkID.prototype.IdBarcodeRecognizerResult = IdBarcodeRecognizerResult; + +/** + * The ID Barcode Recognizer is used for scanning ID Barcode. + */ +function IdBarcodeRecognizer() { + Recognizer.call(this, 'IdBarcodeRecognizer'); + + this.createResultFromNative = function (nativeResult) { return new IdBarcodeRecognizerResult(nativeResult); } + +} + +IdBarcodeRecognizer.prototype = new Recognizer('IdBarcodeRecognizer'); + +BlinkID.prototype.IdBarcodeRecognizer = IdBarcodeRecognizer; + /** * Result object for MrtdCombinedRecognizer. */ @@ -1087,46 +1304,42 @@ function MrtdCombinedRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * Digital signature of the recognition result. Available only if enabled with signResult property. + * Defines digital signature of recognition results. */ this.digitalSignature = nativeResult.digitalSignature; /** - * Version of the digital signature. Available only if enabled with signResult property. + * Defines digital signature version. */ this.digitalSignatureVersion = nativeResult.digitalSignatureVersion; /** - * Returns DataMatchResultSuccess if data from scanned parts/sides of the document match, - * DataMatchResultFailed otherwise. For example if date of expiry is scanned from the front and back side - * of the document and values do not match, this method will return DataMatchResultFailed. Result will - * be DataMatchResultSuccess only if scanned values for all fields that are compared are the same. + * Defines result of the data matching algorithm for scanned parts/sides of the document. */ this.documentDataMatch = nativeResult.documentDataMatch; /** - * face image from the document if enabled with returnFaceImage property. + * Face image from the document */ this.faceImage = nativeResult.faceImage; /** - * back side image of the document if enabled with returnFullDocumentImage property. + * Back side image of the document */ this.fullDocumentBackImage = nativeResult.fullDocumentBackImage; /** - * front side image of the document if enabled with returnFullDocumentImage property. + * Front side image of the document */ this.fullDocumentFrontImage = nativeResult.fullDocumentFrontImage; /** - * Returns the Data extracted from the machine readable zone. + * The data extracted from the machine readable zone. */ this.mrzResult = nativeResult.mrzResult != null ? new MrzResult(nativeResult.mrzResult) : null; /** - * Returns true if recognizer has finished scanning first side and is now scanning back side, - * false if it's still scanning first side. + * {true} if recognizer has finished scanning first side and is now scanning back side, */ this.scanningFirstSideDone = nativeResult.scanningFirstSideDone; @@ -1137,100 +1350,64 @@ MrtdCombinedRecognizerResult.prototype = new RecognizerResult(RecognizerResultSt BlinkID.prototype.MrtdCombinedRecognizerResult = MrtdCombinedRecognizerResult; /** - * MRTD Combined recognizer - * - * MRTD Combined recognizer is used for scanning both front and back side of generic IDs. + * Recognizer for combined reading of face from front side of documents and MRZ from back side of + * * Machine Readable Travel Document. */ function MrtdCombinedRecognizer() { Recognizer.call(this, 'MrtdCombinedRecognizer'); /** - * Whether special characters are allowed - * - * + * Whether special characters are allowed. */ this.allowSpecialCharacters = false; /** - * Whether returning of unparsed results is allowed - * - * + * Whether returning of unparsed results is allowed. */ this.allowUnparsedResults = false; /** - * Whether returning of unverified results is allowed - * Unverified result is result that is parsed, but check digits are incorrect. - * - * + * Whether returning of unverified results is allowed. */ this.allowUnverifiedResults = false; /** - * Type of document this recognizer will scan. - * - * + * Currently used detector type. */ this.detectorType = DocumentFaceDetectorType.TD1; /** - * Property for setting DPI for face images - * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * The DPI (Dots Per Inch) for face image that should be returned. */ this.faceImageDpi = 250; /** - * Property for setting DPI for full document images - * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * The DPI (Dots Per Inch) for full document image that should be returned. */ this.fullDocumentImageDpi = 250; /** - * Image extension factors for full document image. - * - * @see ImageExtensionFactors - * + * The extension factors for full document image. */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** - * Filter for MRTDs (Machine Readable Travel Documents) that is used to determine which documents - * will be processed. If document is filtered out by this filter, its data cannot be returned as recognition result. - */ - this.mrzCombinedFilterDelegate = null; - - /** - * Defines how many times the same document should be detected before the detector - * returns this document as a result of the deteciton - * - * Higher number means more reliable detection, but slower processing - * - * + * Minimum number of stable detections required for detection to be successful. */ this.numStableDetectionsThreshold = 6; /** - * Sets whether face image from ID card should be extracted - * - * + * Defines whether face image will be available in result. */ this.returnFaceImage = false; /** - * Sets whether full document image of ID card should be extracted. - * - * + * Defines whether full document image will be available in */ this.returnFullDocumentImage = false; /** - * Whether or not recognition result should be signed. - * - * + * Defines whether or not recognition result should be signed. */ this.signResult = false; @@ -1249,12 +1426,12 @@ function MrtdRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * full document image if enabled with returnFullDocumentImage property. + * Image of the full document */ this.fullDocumentImage = nativeResult.fullDocumentImage; /** - * Returns the Data extracted from the machine readable zone. + * The Data extracted from the machine readable zone. */ this.mrzResult = nativeResult.mrzResult != null ? new MrzResult(nativeResult.mrzResult) : null; @@ -1265,66 +1442,43 @@ MrtdRecognizerResult.prototype = new RecognizerResult(RecognizerResultState.empt BlinkID.prototype.MrtdRecognizerResult = MrtdRecognizerResult; /** - * Recognizer that can recognizer Machine Readable Zone (MRZ) of the Machine Readable Travel Document (MRTD) + * Recognizer that can recognize Machine Readable Zone (MRZ) of the Machine Readable Travel Document (MRTD) */ function MrtdRecognizer() { Recognizer.call(this, 'MrtdRecognizer'); /** - * Whether special characters are allowed - * - * + * Whether special characters are allowed. */ this.allowSpecialCharacters = false; /** - * Whether returning of unparsed results is allowed - * - * + * Whether returning of unparsed results is allowed. */ this.allowUnparsedResults = false; /** - * Whether returning of unverified results is allowed - * Unverified result is result that is parsed, but check digits are incorrect. - * - * + * Whether returning of unverified results is allowed. */ this.allowUnverifiedResults = false; /** - * Defines if glare detection should be turned on/off. - * - * + * Defines whether glare detector is enabled. */ this.detectGlare = true; /** - * Property for setting DPI for full document images - * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * The DPI (Dots Per Inch) for full document image that should be returned. */ this.fullDocumentImageDpi = 250; /** - * Image extension factors for full document image. - * - * @see ImageExtensionFactors - * + * The extension factors for full document image. */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** - * Filter for MRTDs (Machine Readable Travel Documents) that is used to determine which documents - * will be processed. If document is filtered out by this filter, its data cannot be returned as recognition result. - */ - this.mrzFilterDelegate = null; - - /** - * Sets whether full document image of ID card should be extracted. - * - * + * Defines whether full document image will be available in */ this.returnFullDocumentImage = false; @@ -1343,12 +1497,12 @@ function PassportRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * face image from the document if enabled with returnFaceImage property. + * Face image from the document */ this.faceImage = nativeResult.faceImage; /** - * full document image if enabled with returnFullDocumentImage property. + * Image of the full document */ this.fullDocumentImage = nativeResult.fullDocumentImage; @@ -1370,54 +1524,37 @@ function PassportRecognizer() { Recognizer.call(this, 'PassportRecognizer'); /** - * Defines whether to anonymize Netherlands MRZ - * - * + * Defines whether the Netherlands MRZ should be anonymized. */ this.anonymizeNetherlandsMrz = true; /** - * Defines if glare detection should be turned on/off. - * - * + * Defines whether glare detector is enabled. */ this.detectGlare = true; /** - * Property for setting DPI for face images - * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * The DPI (Dots Per Inch) for face image that should be returned. */ this.faceImageDpi = 250; /** - * Property for setting DPI for full document images - * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * The DPI (Dots Per Inch) for full document image that should be returned. */ this.fullDocumentImageDpi = 250; /** - * Image extension factors for full document image. - * - * @see ImageExtensionFactors - * + * The extension factors for full document image. */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** - * Sets whether face image from ID card should be extracted - * - * + * Defines whether face image will be available in result. */ this.returnFaceImage = false; /** - * Sets whether full document image of ID card should be extracted. - * - * + * Defines whether full document image will be available in */ this.returnFullDocumentImage = false; @@ -1436,12 +1573,12 @@ function VisaRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * face image from the document if enabled with returnFaceImage property. + * Face image from the document */ this.faceImage = nativeResult.faceImage; /** - * full document image if enabled with returnFullDocumentImage property. + * Image of the full document */ this.fullDocumentImage = nativeResult.fullDocumentImage; @@ -1463,47 +1600,32 @@ function VisaRecognizer() { Recognizer.call(this, 'VisaRecognizer'); /** - * Defines if glare detection should be turned on/off. - * - * + * Defines whether glare detector is enabled. */ this.detectGlare = true; /** - * Property for setting DPI for face images - * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * The DPI (Dots Per Inch) for face image that should be returned. */ this.faceImageDpi = 250; /** - * Property for setting DPI for full document images - * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * The DPI (Dots Per Inch) for full document image that should be returned. */ this.fullDocumentImageDpi = 250; /** - * Image extension factors for full document image. - * - * @see ImageExtensionFactors - * + * The extension factors for full document image. */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** - * Sets whether face image from ID card should be extracted - * - * + * Defines whether face image will be available in result. */ this.returnFaceImage = false; /** - * Sets whether full document image of ID card should be extracted. - * - * + * Defines whether full document image will be available in */ this.returnFullDocumentImage = false; From 85a396adc34316b2a646a998d522a58b7c7a6a1c Mon Sep 17 00:00:00 2001 From: Ivan Grce Date: Wed, 18 Mar 2020 15:18:16 +0100 Subject: [PATCH 2/6] Updated plugin version and release notes for v5.3.0 --- BlinkID/package.json | 2 +- BlinkID/plugin.xml | 2 +- Release notes.md | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/BlinkID/package.json b/BlinkID/package.json index 27fcb93..35aefda 100644 --- a/BlinkID/package.json +++ b/BlinkID/package.json @@ -1,6 +1,6 @@ { "name": "blinkid-cordova", - "version": "5.2.0", + "version": "5.3.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 1721cb9..b2fec70 100644 --- a/BlinkID/plugin.xml +++ b/BlinkID/plugin.xml @@ -2,7 +2,7 @@ + version="5.3.0"> BlinkIdScanner A small and powerful ID card scanning library diff --git a/Release notes.md b/Release notes.md index dd86f12..0b994fc 100644 --- a/Release notes.md +++ b/Release notes.md @@ -1,3 +1,6 @@ +## 5.3.0 +- Updated to [Android SDK v5.3.0](https://github.com/BlinkID/blinkid-android/releases/tag/v5.3.0) and [iOS SDK v5.3.0](https://github.com/BlinkID/blinkid-ios/releases/tag/v5.3.0) + ## 5.2.0 - Updated to [Android SDK v5.2.0](https://github.com/BlinkID/blinkid-android/releases/tag/v5.2.0) and [iOS SDK v5.2.0](https://github.com/BlinkID/blinkid-ios/releases/tag/v5.2.0) From 2f8c7f73c5ff64fbadc64dede3cbff8291ac7f0e Mon Sep 17 00:00:00 2001 From: Ivan Grce Date: Thu, 19 Mar 2020 08:52:18 +0100 Subject: [PATCH 3/6] [android] updated license key for v5.3.0 --- www/js/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/js/index.js b/www/js/index.js index 0c88c13..5a0faa6 100644 --- a/www/js/index.js +++ b/www/js/index.js @@ -77,7 +77,7 @@ var app = { // package name/bundleID com.microblink.blinkid var licenseKeys = { - android: 'sRwAAAAWY29tLm1pY3JvYmxpbmsuYmxpbmtpZJ9ew00uWSf86/uxZPNsLDMPOXp1UdfNmlUhMvov7pQ2BPKxOQvgd4e4Gq8RsexLqNUV2HhUZLqsiNT6ZAeHBVSxNtCrxML/LzmtQ6UKkvp2E2vWX8aJtT/kO2dwzuFCs+cRjYFCWs+XS3OGudt53wBMkMtyPE2rpnl7GwUEmQ5lhd/kmeYjKspGNRohQPFcfaGXalD2fudh24WIfP7sgxEWda/PvdrMaBRoaX3OxvFLWcsLHyGBMxrQjBq7P0VDlJ/HCAJMtH4m9fzhWw==', + android: 'sRwAAAAWY29tLm1pY3JvYmxpbmsuYmxpbmtpZJ9ew00uWSf86/uxZPcMKzOCNNOy1ec0P/CixHhywcBYQmwd+wBLbX2mC5NlGNNjn0lNhi/MLrhrgSnzM6A/8DGefBZxOPulaHIkWnWmEvoNq/i9juev6f/4NfVdz1awHmPlGAI2DoYx5ClLcZPvxXONDstVdgnYBO8D3sSY1S1ruae7+cw34L+gSZh2Fp3FWhKI5LG1ALEblkWduzXRYVYx+MjToUNUhxGKefxgSPHaHYEBayecx8u0eP8SNfQcC2rGYxWLXQkqcjVga0a7kQ==', ios: 'sRwAAAEWY29tLm1pY3JvYmxpbmsuYmxpbmtpZFG2rW9X4lA0y++pNb4tS3UVrd+YrVNFzG8W5Mj3ralCcPA9yeD2S5a+daBzhkQAGz1UMQSg7ijGZWIfDyUOjQSV91Uqh7GybSLCnHnsYYPEvEqOcq8z54hQH9uhXZQXMCTMup5P7P/9Sf2Kg9RW5g0j5D8KtVeewqtNrRX/ftcym49exqfskkg2edxg1geNHWLNjTM3s1rTAverP53r8O3RgolUH7M4isUUlGumkq2L0PckLZ+Kww2w04Aq3cJsdF0XIBhej3CgOOIySQ==' }; From 1747069245f503337ac2d73c7bbf2fea3fbb38dc Mon Sep 17 00:00:00 2001 From: Jura Skrlec Date: Thu, 19 Mar 2020 10:36:34 +0100 Subject: [PATCH 4/6] [iOS] Updated bindings v5.3.0 --- BlinkID/plugin.xml | 2 + BlinkID/scripts/initIOSFramework.sh | 2 +- .../MBBlinkIdOverlaySettingsSerialization.m | 98 +++++ .../Recognizers/MBRecognizerSerializers.m | 2 + .../MBBlinkIdCombinedRecognizerWrapper.m | 13 + .../Wrappers/MBBlinkIdRecognizerWrapper.m | 13 + .../Wrappers/MBIdBarcodeRecognizerWrapper.h | 6 + .../Wrappers/MBIdBarcodeRecognizerWrapper.m | 63 +++ BlinkID/www/blinkIdScanner.js | 382 +++++++++++++----- 9 files changed, 483 insertions(+), 98 deletions(-) create mode 100644 BlinkID/src/ios/sources/Recognizers/Wrappers/MBIdBarcodeRecognizerWrapper.h create mode 100644 BlinkID/src/ios/sources/Recognizers/Wrappers/MBIdBarcodeRecognizerWrapper.m diff --git a/BlinkID/plugin.xml b/BlinkID/plugin.xml index b2fec70..208840e 100644 --- a/BlinkID/plugin.xml +++ b/BlinkID/plugin.xml @@ -118,6 +118,7 @@ + @@ -127,6 +128,7 @@ + diff --git a/BlinkID/scripts/initIOSFramework.sh b/BlinkID/scripts/initIOSFramework.sh index f6ada3e..981ad93 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/v5.2.0/blinkid-ios_v5.2.0.zip' +LINK='https://github.com/BlinkID/blinkid-ios/releases/download/v5.3.0/blinkid-ios_v5.3.0.zip' FILENAME='blinkid-ios.zip' # check if Microblink framework and bundle already exist diff --git a/BlinkID/src/ios/sources/Overlays/Serialization/MBBlinkIdOverlaySettingsSerialization.m b/BlinkID/src/ios/sources/Overlays/Serialization/MBBlinkIdOverlaySettingsSerialization.m index ec0e99d..6cda0f6 100644 --- a/BlinkID/src/ios/sources/Overlays/Serialization/MBBlinkIdOverlaySettingsSerialization.m +++ b/BlinkID/src/ios/sources/Overlays/Serialization/MBBlinkIdOverlaySettingsSerialization.m @@ -30,6 +30,104 @@ -(MBOverlayViewController *) createOverlayViewController:(NSDictionary *)jsonOve MBBlinkIdOverlaySettings *sett = [[MBBlinkIdOverlaySettings alloc] init]; self.delegate = delegate; + { + id firstSideInstructionsText = [jsonOverlaySettings valueForKey:@"firstSideInstructionsText"]; + if (firstSideInstructionsText != nil) { + sett.firstSideInstructionsText = (NSString *)firstSideInstructionsText; + } + } + + { + id flipInstructions = [jsonOverlaySettings valueForKey:@"flipInstructions"]; + if (flipInstructions != nil) { + sett.flipInstructions = (NSString *)flipInstructions; + } + } + + { + id errorMoveCloser = [jsonOverlaySettings valueForKey:@"errorMoveCloser"]; + if (errorMoveCloser != nil) { + sett.errorMoveCloser = (NSString *)errorMoveCloser; + } + } + + { + id errorMoveFarther = [jsonOverlaySettings valueForKey:@"errorMoveFarther"]; + if (errorMoveFarther != nil) { + sett.errorMoveFarther = (NSString *)errorMoveFarther; + } + } + + { + id sidesNotMatchingTitle = [jsonOverlaySettings valueForKey:@"sidesNotMatchingTitle"]; + if (sidesNotMatchingTitle != nil) { + sett.sidesNotMatchingTitle = (NSString *)sidesNotMatchingTitle; + } + } + + { + id sidesNotMatchingMessage = [jsonOverlaySettings valueForKey:@"sidesNotMatchingMessage"]; + if (sidesNotMatchingMessage != nil) { + sett.sidesNotMatchingMessage = (NSString *)sidesNotMatchingMessage; + } + } + + { + id unsupportedDocumentTitle = [jsonOverlaySettings valueForKey:@"unsupportedDocumentTitle"]; + if (unsupportedDocumentTitle != nil) { + sett.unsupportedDocumentTitle = (NSString *)unsupportedDocumentTitle; + } + } + + { + id unsupportedDocumentMessage = [jsonOverlaySettings valueForKey:@"unsupportedDocumentMessage"]; + if (unsupportedDocumentMessage != nil) { + sett.unsupportedDocumentMessage = (NSString *)unsupportedDocumentMessage; + } + } + + { + id recognitionTimeoutTitle = [jsonOverlaySettings valueForKey:@"recognitionTimeoutTitle"]; + if (recognitionTimeoutTitle != nil) { + sett.recognitionTimeoutTitle = (NSString *)recognitionTimeoutTitle; + } + } + + { + id recognitionTimeoutMessage = [jsonOverlaySettings valueForKey:@"recognitionTimeoutMessage"]; + if (recognitionTimeoutMessage != nil) { + sett.recognitionTimeoutMessage = (NSString *)recognitionTimeoutMessage; + } + } + + { + id retryButtonText = [jsonOverlaySettings valueForKey:@"retryButtonText"]; + if (retryButtonText != nil) { + sett.retryButtonText = (NSString *)retryButtonText; + } + } + + { + id requireDocumentSidesDataMatch = [jsonOverlaySettings valueForKey:@"requireDocumentSidesDataMatch"]; + if (requireDocumentSidesDataMatch != nil) { + sett.requireDocumentSidesDataMatch = [requireDocumentSidesDataMatch boolValue]; + } + } + + { + id showNotSupportedDialog = [jsonOverlaySettings valueForKey:@"showNotSupportedDialog"]; + if (showNotSupportedDialog != nil) { + sett.showNotSupportedDialog = [showNotSupportedDialog boolValue]; + } + } + + { + id backSideScanningTimeoutMilliseconds = [jsonOverlaySettings valueForKey:@"backSideScanningTimeoutMilliseconds"]; + if (backSideScanningTimeoutMilliseconds != nil) { + sett.backSideScanningTimeout = [backSideScanningTimeoutMilliseconds doubleValue] / 1000.0; + } + } + return [[MBBlinkIdOverlayViewController alloc] initWithSettings:sett recognizerCollection:recognizerCollection delegate:self]; } diff --git a/BlinkID/src/ios/sources/Recognizers/MBRecognizerSerializers.m b/BlinkID/src/ios/sources/Recognizers/MBRecognizerSerializers.m index d67dcc6..539c06e 100644 --- a/BlinkID/src/ios/sources/Recognizers/MBRecognizerSerializers.m +++ b/BlinkID/src/ios/sources/Recognizers/MBRecognizerSerializers.m @@ -5,6 +5,7 @@ #import "MBBlinkIdCombinedRecognizerWrapper.h" #import "MBBlinkIdRecognizerWrapper.h" #import "MBDocumentFaceRecognizerWrapper.h" +#import "MBIdBarcodeRecognizerWrapper.h" #import "MBMrtdCombinedRecognizerWrapper.h" #import "MBMrtdRecognizerWrapper.h" #import "MBPassportRecognizerWrapper.h" @@ -33,6 +34,7 @@ - (instancetype)init { [self registerCreator:[[MBBlinkIdCombinedRecognizerCreator alloc] init]]; [self registerCreator:[[MBBlinkIdRecognizerCreator alloc] init]]; [self registerCreator:[[MBDocumentFaceRecognizerCreator alloc] init]]; + [self registerCreator:[[MBIdBarcodeRecognizerCreator alloc] init]]; [self registerCreator:[[MBMrtdCombinedRecognizerCreator alloc] init]]; [self registerCreator:[[MBMrtdRecognizerCreator alloc] init]]; [self registerCreator:[[MBPassportRecognizerCreator alloc] init]]; diff --git a/BlinkID/src/ios/sources/Recognizers/Wrappers/MBBlinkIdCombinedRecognizerWrapper.m b/BlinkID/src/ios/sources/Recognizers/Wrappers/MBBlinkIdCombinedRecognizerWrapper.m index c66d622..3fa3175 100644 --- a/BlinkID/src/ios/sources/Recognizers/Wrappers/MBBlinkIdCombinedRecognizerWrapper.m +++ b/BlinkID/src/ios/sources/Recognizers/Wrappers/MBBlinkIdCombinedRecognizerWrapper.m @@ -22,6 +22,18 @@ -(MBRecognizer *) createRecognizer:(NSDictionary*) jsonRecognizer { recognizer.allowBlurFilter = [(NSNumber *)allowBlurFilter boolValue]; } } + { + id allowUnparsedMrzResults = [jsonRecognizer valueForKey:@"allowUnparsedMrzResults"]; + if (allowUnparsedMrzResults != nil) { + recognizer.allowUnparsedMrzResults = [(NSNumber *)allowUnparsedMrzResults boolValue]; + } + } + { + id allowUnverifiedMrzResults = [jsonRecognizer valueForKey:@"allowUnverifiedMrzResults"]; + if (allowUnverifiedMrzResults != nil) { + recognizer.allowUnverifiedMrzResults = [(NSNumber *)allowUnverifiedMrzResults boolValue]; + } + } { id faceImageDpi = [jsonRecognizer valueForKey:@"faceImageDpi"]; if (faceImageDpi != nil) { @@ -77,6 +89,7 @@ -(NSDictionary *) serializeResult { [jsonResult setValue:self.result.conditions forKey:@"conditions"]; [jsonResult setValue:[MBSerializationUtils serializeMBDateResult:self.result.dateOfBirth] forKey:@"dateOfBirth"]; [jsonResult setValue:[MBSerializationUtils serializeMBDateResult:self.result.dateOfExpiry] forKey:@"dateOfExpiry"]; + [jsonResult setValue:[NSNumber numberWithBool:self.result.dateOfExpiryPermanent] forKey:@"dateOfExpiryPermanent"]; [jsonResult setValue:[MBSerializationUtils serializeMBDateResult:self.result.dateOfIssue] forKey:@"dateOfIssue"]; [jsonResult setValue:[self.result.digitalSignature base64EncodedStringWithOptions:0] forKey:@"digitalSignature"]; [jsonResult setValue:[NSNumber numberWithUnsignedInteger:self.result.digitalSignatureVersion] forKey:@"digitalSignatureVersion"]; diff --git a/BlinkID/src/ios/sources/Recognizers/Wrappers/MBBlinkIdRecognizerWrapper.m b/BlinkID/src/ios/sources/Recognizers/Wrappers/MBBlinkIdRecognizerWrapper.m index 3fd6065..5779782 100644 --- a/BlinkID/src/ios/sources/Recognizers/Wrappers/MBBlinkIdRecognizerWrapper.m +++ b/BlinkID/src/ios/sources/Recognizers/Wrappers/MBBlinkIdRecognizerWrapper.m @@ -22,6 +22,18 @@ -(MBRecognizer *) createRecognizer:(NSDictionary*) jsonRecognizer { recognizer.allowBlurFilter = [(NSNumber *)allowBlurFilter boolValue]; } } + { + id allowUnparsedMrzResults = [jsonRecognizer valueForKey:@"allowUnparsedMrzResults"]; + if (allowUnparsedMrzResults != nil) { + recognizer.allowUnparsedMrzResults = [(NSNumber *)allowUnparsedMrzResults boolValue]; + } + } + { + id allowUnverifiedMrzResults = [jsonRecognizer valueForKey:@"allowUnverifiedMrzResults"]; + if (allowUnverifiedMrzResults != nil) { + recognizer.allowUnverifiedMrzResults = [(NSNumber *)allowUnverifiedMrzResults boolValue]; + } + } { id faceImageDpi = [jsonRecognizer valueForKey:@"faceImageDpi"]; if (faceImageDpi != nil) { @@ -71,6 +83,7 @@ -(NSDictionary *) serializeResult { [jsonResult setValue:self.result.conditions forKey:@"conditions"]; [jsonResult setValue:[MBSerializationUtils serializeMBDateResult:self.result.dateOfBirth] forKey:@"dateOfBirth"]; [jsonResult setValue:[MBSerializationUtils serializeMBDateResult:self.result.dateOfExpiry] forKey:@"dateOfExpiry"]; + [jsonResult setValue:[NSNumber numberWithBool:self.result.dateOfExpiryPermanent] forKey:@"dateOfExpiryPermanent"]; [jsonResult setValue:[MBSerializationUtils serializeMBDateResult:self.result.dateOfIssue] forKey:@"dateOfIssue"]; [jsonResult setValue:self.result.documentAdditionalNumber forKey:@"documentAdditionalNumber"]; [jsonResult setValue:self.result.documentNumber forKey:@"documentNumber"]; diff --git a/BlinkID/src/ios/sources/Recognizers/Wrappers/MBIdBarcodeRecognizerWrapper.h b/BlinkID/src/ios/sources/Recognizers/Wrappers/MBIdBarcodeRecognizerWrapper.h new file mode 100644 index 0000000..84aab31 --- /dev/null +++ b/BlinkID/src/ios/sources/Recognizers/Wrappers/MBIdBarcodeRecognizerWrapper.h @@ -0,0 +1,6 @@ +#import "MBRecognizerWrapper.h" +#import + +@interface MBIdBarcodeRecognizerCreator : NSObject + +@end \ No newline at end of file diff --git a/BlinkID/src/ios/sources/Recognizers/Wrappers/MBIdBarcodeRecognizerWrapper.m b/BlinkID/src/ios/sources/Recognizers/Wrappers/MBIdBarcodeRecognizerWrapper.m new file mode 100644 index 0000000..cf9a634 --- /dev/null +++ b/BlinkID/src/ios/sources/Recognizers/Wrappers/MBIdBarcodeRecognizerWrapper.m @@ -0,0 +1,63 @@ +#import "MBIdBarcodeRecognizerWrapper.h" +#import "MBSerializationUtils.h" +#import "MBBlinkIDSerializationUtils.h" + +@implementation MBIdBarcodeRecognizerCreator + +@synthesize jsonName = _jsonName; + +-(instancetype) init { + self = [super init]; + if (self) { + _jsonName = @"IdBarcodeRecognizer"; + } + return self; +} + +-(MBRecognizer *) createRecognizer:(NSDictionary*) jsonRecognizer { + MBIdBarcodeRecognizer *recognizer = [[MBIdBarcodeRecognizer alloc] init]; + + return recognizer; +} + +@end + +@interface MBIdBarcodeRecognizer (JsonSerialization) +@end + +@implementation MBIdBarcodeRecognizer (JsonSerialization) + +-(NSDictionary *) serializeResult { + NSMutableDictionary* jsonResult = (NSMutableDictionary*)[super serializeResult]; + [jsonResult setValue:self.result.additionalAddressInformation forKey:@"additionalAddressInformation"]; + [jsonResult setValue:self.result.additionalNameInformation forKey:@"additionalNameInformation"]; + [jsonResult setValue:self.result.address forKey:@"address"]; + [jsonResult setValue:[NSNumber numberWithInteger:(self.result.barcodeType + 1)] forKey:@"barcodeType"]; + [jsonResult setValue:[MBSerializationUtils serializeMBDateResult:self.result.dateOfBirth] forKey:@"dateOfBirth"]; + [jsonResult setValue:[MBSerializationUtils serializeMBDateResult:self.result.dateOfExpiry] forKey:@"dateOfExpiry"]; + [jsonResult setValue:[MBSerializationUtils serializeMBDateResult:self.result.dateOfIssue] forKey:@"dateOfIssue"]; + [jsonResult setValue:self.result.documentAdditionalNumber forKey:@"documentAdditionalNumber"]; + [jsonResult setValue:self.result.documentNumber forKey:@"documentNumber"]; + [jsonResult setValue:[NSNumber numberWithInteger:(self.result.documentType + 1)] forKey:@"documentType"]; + [jsonResult setValue:self.result.employer forKey:@"employer"]; + [jsonResult setValue:self.result.firstName forKey:@"firstName"]; + [jsonResult setValue:self.result.fullName forKey:@"fullName"]; + [jsonResult setValue:self.result.issuingAuthority forKey:@"issuingAuthority"]; + [jsonResult setValue:self.result.lastName forKey:@"lastName"]; + [jsonResult setValue:self.result.maritalStatus forKey:@"maritalStatus"]; + [jsonResult setValue:self.result.nationality forKey:@"nationality"]; + [jsonResult setValue:self.result.personalIdNumber forKey:@"personalIdNumber"]; + [jsonResult setValue:self.result.placeOfBirth forKey:@"placeOfBirth"]; + [jsonResult setValue:self.result.profession forKey:@"profession"]; + [jsonResult setValue:self.result.race forKey:@"race"]; + [jsonResult setValue:[self.result.rawData base64EncodedStringWithOptions:0] forKey:@"rawData"]; + [jsonResult setValue:self.result.religion forKey:@"religion"]; + [jsonResult setValue:self.result.residentialStatus forKey:@"residentialStatus"]; + [jsonResult setValue:self.result.sex forKey:@"sex"]; + [jsonResult setValue:self.result.stringData forKey:@"stringData"]; + [jsonResult setValue:[NSNumber numberWithBool:self.result.uncertain] forKey:@"uncertain"]; + + return jsonResult; +} + +@end \ No newline at end of file diff --git a/BlinkID/www/blinkIdScanner.js b/BlinkID/www/blinkIdScanner.js index 56260ac..6e7474c 100644 --- a/BlinkID/www/blinkIdScanner.js +++ b/BlinkID/www/blinkIdScanner.js @@ -610,7 +610,7 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * The additional name information of the document owner. + * The additional address information of the document owner. */ this.additionalAddressInformation = nativeResult.additionalAddressInformation; @@ -650,12 +650,12 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.dateOfIssue = nativeResult.dateOfIssue != null ? new Date(nativeResult.dateOfIssue) : null; /** - * Defines digital signature of recognition results. + * Digital signature of the recognition result. Available only if enabled with signResult property. */ this.digitalSignature = nativeResult.digitalSignature; /** - * Defines digital signature version. + * Version of the digital signature. Available only if enabled with signResult property. */ this.digitalSignatureVersion = nativeResult.digitalSignatureVersion; @@ -665,7 +665,10 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.documentAdditionalNumber = nativeResult.documentAdditionalNumber; /** - * Defines result of the data matching algorithm for scanned parts/sides of the document. + * Returns DataMatchResultSuccess if data from scanned parts/sides of the document match, + * DataMatchResultFailed otherwise. For example if date of expiry is scanned from the front and back side + * of the document and values do not match, this method will return DataMatchResultFailed. Result will + * be DataMatchResultSuccess only if scanned values for all fields that are compared are the same. */ this.documentDataMatch = nativeResult.documentDataMatch; @@ -685,7 +688,7 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.employer = nativeResult.employer; /** - * Face image from the document + * face image from the document if enabled with returnFaceImage property. */ this.faceImage = nativeResult.faceImage; @@ -695,12 +698,12 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.firstName = nativeResult.firstName; /** - * Back side image of the document + * back side image of the document if enabled with returnFullDocumentImage property. */ this.fullDocumentBackImage = nativeResult.fullDocumentBackImage; /** - * Front side image of the document + * front side image of the document if enabled with returnFullDocumentImage property. */ this.fullDocumentFrontImage = nativeResult.fullDocumentFrontImage; @@ -730,7 +733,7 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.maritalStatus = nativeResult.maritalStatus; /** - * The data extracted from the machine readable zone. + * The data extracted from the machine readable zone */ this.mrzResult = nativeResult.mrzResult != null ? new MrzResult(nativeResult.mrzResult) : null; @@ -770,7 +773,8 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.residentialStatus = nativeResult.residentialStatus; /** - * {true} if recognizer has finished scanning first side and is now scanning back side, + * Returns true if recognizer has finished scanning first side and is now scanning back side, + * false if it's still scanning first side. */ this.scanningFirstSideDone = nativeResult.scanningFirstSideDone; @@ -786,53 +790,85 @@ BlinkIdCombinedRecognizerResult.prototype = new RecognizerResult(RecognizerResul BlinkID.prototype.BlinkIdCombinedRecognizerResult = BlinkIdCombinedRecognizerResult; /** - * A generic recognizer which can scan front and back side of the document. + * Recognizer which can scan front and back side of the United States driver license. */ function BlinkIdCombinedRecognizer() { Recognizer.call(this, 'BlinkIdCombinedRecognizer'); /** - * Defines whether blured frames filtering is allowed. + * Defines whether blured frames filtering is allowed + * + * */ this.allowBlurFilter = true; /** - * Defines whether returning of unparsed MRZ (Machine Readable Zone) results is allowed. + * Defines whether returning of unparsed MRZ (Machine Readable Zone) results is allowed + * + * */ this.allowUnparsedMrzResults = false; /** - * Defines whether returning unverified MRZ (Machine Readable Zone) results is allowed. + * Defines whether returning unverified MRZ (Machine Readable Zone) results is allowed + * Unverified MRZ is parsed, but check digits are incorrect + * + * */ this.allowUnverifiedMrzResults = true; /** - * The DPI (Dots Per Inch) for face image that should be returned. + * Document not supported classifier delegate + */ + this.classifierDelegate = null; + + /** + * Full document dewarped imagedelegate + */ + this.dewarpedImageDelegate = null; + + /** + * Property for setting DPI for face images + * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception + * + * */ this.faceImageDpi = 250; /** - * The DPI (Dots Per Inch) for full document image that should be returned. + * Property for setting DPI for full document images + * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception + * + * */ this.fullDocumentImageDpi = 250; /** - * The extension factors for full document image. + * Image extension factors for full document image. + * + * @see ImageExtensionFactors + * */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** - * Defines whether face image will be available in result. + * Sets whether face image from ID card should be extracted + * + * */ this.returnFaceImage = false; /** - * Defines whether full document image will be available in + * Sets whether full document image of ID card should be extracted. + * + * */ this.returnFullDocumentImage = false; /** - * Defines whether or not recognition result should be signed. + * Whether or not recognition result should be signed. + * + * */ this.signResult = false; @@ -851,7 +887,7 @@ function BlinkIdRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * The additional name information of the document owner. + * The additional address information of the document owner. */ this.additionalAddressInformation = nativeResult.additionalAddressInformation; @@ -911,7 +947,7 @@ function BlinkIdRecognizerResult(nativeResult) { this.employer = nativeResult.employer; /** - * Face image from the document + * face image from the document if enabled with returnFaceImage property. */ this.faceImage = nativeResult.faceImage; @@ -921,7 +957,7 @@ function BlinkIdRecognizerResult(nativeResult) { this.firstName = nativeResult.firstName; /** - * Image of the full document + * full document image if enabled with returnFullDocumentImage property. */ this.fullDocumentImage = nativeResult.fullDocumentImage; @@ -951,7 +987,7 @@ function BlinkIdRecognizerResult(nativeResult) { this.maritalStatus = nativeResult.maritalStatus; /** - * The data extracted from the machine readable zone. + * The data extracted from the machine readable zone */ this.mrzResult = nativeResult.mrzResult != null ? new MrzResult(nativeResult.mrzResult) : null; @@ -1002,48 +1038,78 @@ BlinkIdRecognizerResult.prototype = new RecognizerResult(RecognizerResultState.e BlinkID.prototype.BlinkIdRecognizerResult = BlinkIdRecognizerResult; /** - * Generic BlinkID recognizer. + * The Blink ID Recognizer is used for scanning Blink ID. */ function BlinkIdRecognizer() { Recognizer.call(this, 'BlinkIdRecognizer'); /** - * Defines whether blured frames filtering is allowed" + * Defines whether blured frames filtering is allowed + * + * */ this.allowBlurFilter = true; /** - * Defines whether returning of unparsed MRZ (Machine Readable Zone) results is allowed. + * Defines whether returning of unparsed MRZ (Machine Readable Zone) results is allowed + * + * */ this.allowUnparsedMrzResults = false; /** - * Defines whether returning unverified MRZ (Machine Readable Zone) results is allowed. + * Defines whether returning unverified MRZ (Machine Readable Zone) results is allowed + * Unverified MRZ is parsed, but check digits are incorrect + * + * */ this.allowUnverifiedMrzResults = true; /** - * The DPI (Dots Per Inch) for face image that should be returned. + * Document not supported classifier delegate + */ + this.classifierDelegate = null; + + /** + * Full document dewarped imagedelegate + */ + this.dewarpedImageDelegate = null; + + /** + * Property for setting DPI for face images + * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception + * + * */ this.faceImageDpi = 250; /** - * The DPI (Dots Per Inch) for full document image that should be returned. + * Property for setting DPI for full document images + * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception + * + * */ this.fullDocumentImageDpi = 250; /** - * The extension factors for full document image. + * Image extension factors for full document image. + * + * @see ImageExtensionFactors + * */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** - * Defines whether face image will be available in result. + * Sets whether face image from ID card should be extracted + * + * */ this.returnFaceImage = false; /** - * Defines whether full document image will be available in + * Sets whether full document image of ID card should be extracted. + * + * */ this.returnFullDocumentImage = false; @@ -1062,22 +1128,22 @@ function DocumentFaceRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * The location of document detection in coordinate system of full input frame. + * Quadrangle represeting corner points of the document within the input image. */ this.documentLocation = nativeResult.documentLocation != null ? new Quadrilateral(nativeResult.documentLocation) : null; /** - * Face image from the document + * face image from the document if enabled with returnFaceImage property. */ this.faceImage = nativeResult.faceImage; /** - * The location of face detection in coordinate system of cropped full document image. + * Quadrangle represeting corner points of the face image within the input image. */ this.faceLocation = nativeResult.faceLocation != null ? new Quadrilateral(nativeResult.faceLocation) : null; /** - * Image of the full document + * full document image if enabled with returnFullDocumentImage property. */ this.fullDocumentImage = nativeResult.fullDocumentImage; @@ -1088,43 +1154,65 @@ DocumentFaceRecognizerResult.prototype = new RecognizerResult(RecognizerResultSt BlinkID.prototype.DocumentFaceRecognizerResult = DocumentFaceRecognizerResult; /** - * Recognizer for detecting holder's photo on documents containing image. + * Class for configuring Document Face Recognizer Recognizer. + * + * Document Face Recognizer recognizer is used for scanning documents containing face images. */ function DocumentFaceRecognizer() { Recognizer.call(this, 'DocumentFaceRecognizer'); /** - * Currently used detector type. + * Type of docment this recognizer will scan. + * + * */ this.detectorType = DocumentFaceDetectorType.TD1; /** - * The DPI (Dots Per Inch) for face image that should be returned. + * Property for setting DPI for face images + * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception + * + * */ this.faceImageDpi = 250; /** - * The DPI (Dots Per Inch) for full document image that should be returned. + * Property for setting DPI for full document images + * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception + * + * */ this.fullDocumentImageDpi = 250; /** - * The extension factors for full document image. + * Image extension factors for full document image. + * + * @see ImageExtensionFactors + * */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** - * Minimum number of stable detections required for detection to be successful. + * Defines how many times the same document should be detected before the detector + * returns this document as a result of the deteciton + * + * Higher number means more reliable detection, but slower processing + * + * */ this.numStableDetectionsThreshold = 6; /** - * Defines whether face image will be available in result. + * Sets whether face image from ID card should be extracted + * + * */ this.returnFaceImage = false; /** - * Defines whether full document image will be available in + * Sets whether full document image of ID card should be extracted. + * + * */ this.returnFullDocumentImage = false; @@ -1158,7 +1246,9 @@ function IdBarcodeRecognizerResult(nativeResult) { this.address = nativeResult.address; /** - * The format of the scanned barcode. + * Type of the barcode scanned + * + * @return Type of the barcode */ this.barcodeType = nativeResult.barcodeType; @@ -1188,7 +1278,9 @@ function IdBarcodeRecognizerResult(nativeResult) { this.documentNumber = nativeResult.documentNumber; /** - * The document type deduced from the recognized barcode + * The document type deduced from the recognized barcode + * + * @return Type of the document */ this.documentType = nativeResult.documentType; @@ -1248,7 +1340,7 @@ function IdBarcodeRecognizerResult(nativeResult) { this.race = nativeResult.race; /** - * The raw bytes contained inside barcode. + * Byte array with result of the scan */ this.rawData = nativeResult.rawData; @@ -1268,12 +1360,13 @@ function IdBarcodeRecognizerResult(nativeResult) { this.sex = nativeResult.sex; /** - * String representation of data inside barcode. + * Retrieves string content of scanned data */ this.stringData = nativeResult.stringData; /** - * True if returned result is uncertain, i.e. if scanned barcode was incomplete (i.e. + * Flag indicating uncertain scanning data + * E.g obtained from damaged barcode. */ this.uncertain = nativeResult.uncertain; @@ -1304,42 +1397,46 @@ function MrtdCombinedRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * Defines digital signature of recognition results. + * Digital signature of the recognition result. Available only if enabled with signResult property. */ this.digitalSignature = nativeResult.digitalSignature; /** - * Defines digital signature version. + * Version of the digital signature. Available only if enabled with signResult property. */ this.digitalSignatureVersion = nativeResult.digitalSignatureVersion; /** - * Defines result of the data matching algorithm for scanned parts/sides of the document. + * Returns DataMatchResultSuccess if data from scanned parts/sides of the document match, + * DataMatchResultFailed otherwise. For example if date of expiry is scanned from the front and back side + * of the document and values do not match, this method will return DataMatchResultFailed. Result will + * be DataMatchResultSuccess only if scanned values for all fields that are compared are the same. */ this.documentDataMatch = nativeResult.documentDataMatch; /** - * Face image from the document + * face image from the document if enabled with returnFaceImage property. */ this.faceImage = nativeResult.faceImage; /** - * Back side image of the document + * back side image of the document if enabled with returnFullDocumentImage property. */ this.fullDocumentBackImage = nativeResult.fullDocumentBackImage; /** - * Front side image of the document + * front side image of the document if enabled with returnFullDocumentImage property. */ this.fullDocumentFrontImage = nativeResult.fullDocumentFrontImage; /** - * The data extracted from the machine readable zone. + * Returns the Data extracted from the machine readable zone. */ this.mrzResult = nativeResult.mrzResult != null ? new MrzResult(nativeResult.mrzResult) : null; /** - * {true} if recognizer has finished scanning first side and is now scanning back side, + * Returns true if recognizer has finished scanning first side and is now scanning back side, + * false if it's still scanning first side. */ this.scanningFirstSideDone = nativeResult.scanningFirstSideDone; @@ -1350,64 +1447,100 @@ MrtdCombinedRecognizerResult.prototype = new RecognizerResult(RecognizerResultSt BlinkID.prototype.MrtdCombinedRecognizerResult = MrtdCombinedRecognizerResult; /** - * Recognizer for combined reading of face from front side of documents and MRZ from back side of - * * Machine Readable Travel Document. + * MRTD Combined recognizer + * + * MRTD Combined recognizer is used for scanning both front and back side of generic IDs. */ function MrtdCombinedRecognizer() { Recognizer.call(this, 'MrtdCombinedRecognizer'); /** - * Whether special characters are allowed. + * Whether special characters are allowed + * + * */ this.allowSpecialCharacters = false; /** - * Whether returning of unparsed results is allowed. + * Whether returning of unparsed results is allowed + * + * */ this.allowUnparsedResults = false; /** - * Whether returning of unverified results is allowed. + * Whether returning of unverified results is allowed + * Unverified result is result that is parsed, but check digits are incorrect. + * + * */ this.allowUnverifiedResults = false; /** - * Currently used detector type. + * Type of document this recognizer will scan. + * + * */ this.detectorType = DocumentFaceDetectorType.TD1; /** - * The DPI (Dots Per Inch) for face image that should be returned. + * Property for setting DPI for face images + * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception + * + * */ this.faceImageDpi = 250; /** - * The DPI (Dots Per Inch) for full document image that should be returned. + * Property for setting DPI for full document images + * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception + * + * */ this.fullDocumentImageDpi = 250; /** - * The extension factors for full document image. + * Image extension factors for full document image. + * + * @see ImageExtensionFactors + * */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** - * Minimum number of stable detections required for detection to be successful. + * Filter for MRTDs (Machine Readable Travel Documents) that is used to determine which documents + * will be processed. If document is filtered out by this filter, its data cannot be returned as recognition result. + */ + this.mrzCombinedFilterDelegate = null; + + /** + * Defines how many times the same document should be detected before the detector + * returns this document as a result of the deteciton + * + * Higher number means more reliable detection, but slower processing + * + * */ this.numStableDetectionsThreshold = 6; /** - * Defines whether face image will be available in result. + * Sets whether face image from ID card should be extracted + * + * */ this.returnFaceImage = false; /** - * Defines whether full document image will be available in + * Sets whether full document image of ID card should be extracted. + * + * */ this.returnFullDocumentImage = false; /** - * Defines whether or not recognition result should be signed. + * Whether or not recognition result should be signed. + * + * */ this.signResult = false; @@ -1426,12 +1559,12 @@ function MrtdRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * Image of the full document + * full document image if enabled with returnFullDocumentImage property. */ this.fullDocumentImage = nativeResult.fullDocumentImage; /** - * The Data extracted from the machine readable zone. + * Returns the Data extracted from the machine readable zone. */ this.mrzResult = nativeResult.mrzResult != null ? new MrzResult(nativeResult.mrzResult) : null; @@ -1442,43 +1575,66 @@ MrtdRecognizerResult.prototype = new RecognizerResult(RecognizerResultState.empt BlinkID.prototype.MrtdRecognizerResult = MrtdRecognizerResult; /** - * Recognizer that can recognize Machine Readable Zone (MRZ) of the Machine Readable Travel Document (MRTD) + * Recognizer that can recognizer Machine Readable Zone (MRZ) of the Machine Readable Travel Document (MRTD) */ function MrtdRecognizer() { Recognizer.call(this, 'MrtdRecognizer'); /** - * Whether special characters are allowed. + * Whether special characters are allowed + * + * */ this.allowSpecialCharacters = false; /** - * Whether returning of unparsed results is allowed. + * Whether returning of unparsed results is allowed + * + * */ this.allowUnparsedResults = false; /** - * Whether returning of unverified results is allowed. + * Whether returning of unverified results is allowed + * Unverified result is result that is parsed, but check digits are incorrect. + * + * */ this.allowUnverifiedResults = false; /** - * Defines whether glare detector is enabled. + * Defines if glare detection should be turned on/off. + * + * */ this.detectGlare = true; /** - * The DPI (Dots Per Inch) for full document image that should be returned. + * Property for setting DPI for full document images + * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception + * + * */ this.fullDocumentImageDpi = 250; /** - * The extension factors for full document image. + * Image extension factors for full document image. + * + * @see ImageExtensionFactors + * */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** - * Defines whether full document image will be available in + * Filter for MRTDs (Machine Readable Travel Documents) that is used to determine which documents + * will be processed. If document is filtered out by this filter, its data cannot be returned as recognition result. + */ + this.mrzFilterDelegate = null; + + /** + * Sets whether full document image of ID card should be extracted. + * + * */ this.returnFullDocumentImage = false; @@ -1497,12 +1653,12 @@ function PassportRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * Face image from the document + * face image from the document if enabled with returnFaceImage property. */ this.faceImage = nativeResult.faceImage; /** - * Image of the full document + * full document image if enabled with returnFullDocumentImage property. */ this.fullDocumentImage = nativeResult.fullDocumentImage; @@ -1524,37 +1680,54 @@ function PassportRecognizer() { Recognizer.call(this, 'PassportRecognizer'); /** - * Defines whether the Netherlands MRZ should be anonymized. + * Defines whether to anonymize Netherlands MRZ + * + * */ this.anonymizeNetherlandsMrz = true; /** - * Defines whether glare detector is enabled. + * Defines if glare detection should be turned on/off. + * + * */ this.detectGlare = true; /** - * The DPI (Dots Per Inch) for face image that should be returned. + * Property for setting DPI for face images + * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception + * + * */ this.faceImageDpi = 250; /** - * The DPI (Dots Per Inch) for full document image that should be returned. + * Property for setting DPI for full document images + * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception + * + * */ this.fullDocumentImageDpi = 250; /** - * The extension factors for full document image. + * Image extension factors for full document image. + * + * @see ImageExtensionFactors + * */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** - * Defines whether face image will be available in result. + * Sets whether face image from ID card should be extracted + * + * */ this.returnFaceImage = false; /** - * Defines whether full document image will be available in + * Sets whether full document image of ID card should be extracted. + * + * */ this.returnFullDocumentImage = false; @@ -1573,12 +1746,12 @@ function VisaRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * Face image from the document + * face image from the document if enabled with returnFaceImage property. */ this.faceImage = nativeResult.faceImage; /** - * Image of the full document + * full document image if enabled with returnFullDocumentImage property. */ this.fullDocumentImage = nativeResult.fullDocumentImage; @@ -1600,32 +1773,47 @@ function VisaRecognizer() { Recognizer.call(this, 'VisaRecognizer'); /** - * Defines whether glare detector is enabled. + * Defines if glare detection should be turned on/off. + * + * */ this.detectGlare = true; /** - * The DPI (Dots Per Inch) for face image that should be returned. + * Property for setting DPI for face images + * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception + * + * */ this.faceImageDpi = 250; /** - * The DPI (Dots Per Inch) for full document image that should be returned. + * Property for setting DPI for full document images + * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception + * + * */ this.fullDocumentImageDpi = 250; /** - * The extension factors for full document image. + * Image extension factors for full document image. + * + * @see ImageExtensionFactors + * */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** - * Defines whether face image will be available in result. + * Sets whether face image from ID card should be extracted + * + * */ this.returnFaceImage = false; /** - * Defines whether full document image will be available in + * Sets whether full document image of ID card should be extracted. + * + * */ this.returnFullDocumentImage = false; From 232daa78cfcba74c512f70928384f5f89e647dfe Mon Sep 17 00:00:00 2001 From: Jura Skrlec Date: Thu, 19 Mar 2020 10:36:45 +0100 Subject: [PATCH 5/6] [iOS] Updated license key v5.3.0 --- www/js/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/js/index.js b/www/js/index.js index 5a0faa6..4747114 100644 --- a/www/js/index.js +++ b/www/js/index.js @@ -78,7 +78,7 @@ var app = { // package name/bundleID com.microblink.blinkid var licenseKeys = { android: 'sRwAAAAWY29tLm1pY3JvYmxpbmsuYmxpbmtpZJ9ew00uWSf86/uxZPcMKzOCNNOy1ec0P/CixHhywcBYQmwd+wBLbX2mC5NlGNNjn0lNhi/MLrhrgSnzM6A/8DGefBZxOPulaHIkWnWmEvoNq/i9juev6f/4NfVdz1awHmPlGAI2DoYx5ClLcZPvxXONDstVdgnYBO8D3sSY1S1ruae7+cw34L+gSZh2Fp3FWhKI5LG1ALEblkWduzXRYVYx+MjToUNUhxGKefxgSPHaHYEBayecx8u0eP8SNfQcC2rGYxWLXQkqcjVga0a7kQ==', - ios: 'sRwAAAEWY29tLm1pY3JvYmxpbmsuYmxpbmtpZFG2rW9X4lA0y++pNb4tS3UVrd+YrVNFzG8W5Mj3ralCcPA9yeD2S5a+daBzhkQAGz1UMQSg7ijGZWIfDyUOjQSV91Uqh7GybSLCnHnsYYPEvEqOcq8z54hQH9uhXZQXMCTMup5P7P/9Sf2Kg9RW5g0j5D8KtVeewqtNrRX/ftcym49exqfskkg2edxg1geNHWLNjTM3s1rTAverP53r8O3RgolUH7M4isUUlGumkq2L0PckLZ+Kww2w04Aq3cJsdF0XIBhej3CgOOIySQ==' + ios: 'sRwAAAEWY29tLm1pY3JvYmxpbmsuYmxpbmtpZFG2rW9X4lA0y++pNbrNSXU9j08ergMPUmsCXxJMGTuECq91Y5sRP4fq0pZb069yM4V5US2psR7OeYLwjmZr9ixYrpnRWdFFRqO9730tCFmdrK2ZAstMXEBBcLqGI8z9dJwT8eFQlv4caQmAlzTLl0c7VmbKl+ysb8XBQsjUcIv6lwUksFIkt9nBBVrCduzev8HvKwKQw7kmm/xXrcrNxHWzkwgum7r3D5rsFf9cJapU9zoltHdwyyUdcBONELtK1mZvvS6lTGsfebW2F+0pHw==' }; scanButton.addEventListener('click', function() { From 5a0bf85b12144cbec4873289605a4e27549ec16c Mon Sep 17 00:00:00 2001 From: Ivan Grce Date: Thu, 19 Mar 2020 11:36:33 +0100 Subject: [PATCH 6/6] [android] BlinkIdOverlaySettingsSerialization fix --- .../serialization/BlinkIdOverlaySettingsSerialization.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BlinkID/src/android/java/com/phonegap/plugins/microblink/overlays/serialization/BlinkIdOverlaySettingsSerialization.java b/BlinkID/src/android/java/com/phonegap/plugins/microblink/overlays/serialization/BlinkIdOverlaySettingsSerialization.java index 808a228..809a49d 100644 --- a/BlinkID/src/android/java/com/phonegap/plugins/microblink/overlays/serialization/BlinkIdOverlaySettingsSerialization.java +++ b/BlinkID/src/android/java/com/phonegap/plugins/microblink/overlays/serialization/BlinkIdOverlaySettingsSerialization.java @@ -23,8 +23,8 @@ public UISettings createUISettings(Context context, JSONObject jsonUISettings, R boolean showNotSupportedDialog = jsonUISettings.optBoolean("showNotSupportedDialog", true); settings.setShowNotSupportedDialog(showNotSupportedDialog); - long backSideScanningTimeoutMiliseconds = jsonUISettings.optLong("backSideScanningTimeoutMilliseconds", 17_00); - settings.setBackSideScanningTimeoutMs(backSideScanningTimeoutMiliseconds); + long backSideScanningTimeoutMilliseconds = jsonUISettings.optLong("backSideScanningTimeoutMilliseconds", 17000); + settings.setBackSideScanningTimeoutMs(backSideScanningTimeoutMilliseconds); ReticleOverlayStrings.Builder overlasStringsBuilder = new ReticleOverlayStrings.Builder(context);