Skip to content

Commit

Permalink
Merge pull request #169 from BlinkID/release/6.11
Browse files Browse the repository at this point in the history
Release/6.11
  • Loading branch information
mparadina authored Oct 14, 2024
2 parents 1e0ee6d + ff45802 commit 7d342a9
Show file tree
Hide file tree
Showing 15 changed files with 161 additions and 9 deletions.
2 changes: 1 addition & 1 deletion BlinkID/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blinkid-cordova",
"version": "6.10.0",
"version": "6.11.0",
"description": "A small and powerful ID card scanning library",
"cordova": {
"id": "blinkid-cordova",
Expand Down
4 changes: 2 additions & 2 deletions BlinkID/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="blinkid-cordova"
version="6.10.0">
version="6.11.0">

<name>BlinkIdScanner</name>
<description>A small and powerful ID card scanning library</description>
Expand Down Expand Up @@ -153,7 +153,7 @@
<framework src="AudioToolbox.framework" />
<framework src="OpenGLES.framework" />
<framework src="Accelerate.framework" />
<framework src="src/ios/blinkid-ios/BlinkID.xcframework" custom="true" embed="true"/>
<framework src="src/ios/BlinkID.xcframework" custom="true" embed="true"/>
<preference name="CAMERA_USAGE_DESCRIPTION" default=" " />
<config-file target="*-Info.plist" parent="NSCameraUsageDescription">
<string>$CAMERA_USAGE_DESCRIPTION</string>
Expand Down
2 changes: 1 addition & 1 deletion BlinkID/scripts/initIOSFramework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
HERE="$(dirname "$(test -L "$0" && readlink "$0" || echo "$0")")"
pushd "${HERE}/../src/ios/" > /dev/null

LINK='https://github.com/BlinkID/blinkid-ios/releases/download/v6.10.1/BlinkID.xcframework.zip'
LINK='https://github.com/BlinkID/blinkid-ios/releases/download/v6.11.0/BlinkID.xcframework.zip'
FILENAME='BlinkID.xcframework.zip'

# BlinkID framework will be obtained via wget or curl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import com.microblink.blinkid.entities.recognizers.blinkid.generic.DocumentNumberAnonymizationSettings;
import com.microblink.blinkid.entities.recognizers.blinkid.generic.CustomClassRules;
import com.microblink.blinkid.entities.recognizers.blinkid.generic.DetailedFieldType;
import com.microblink.blinkid.entities.recognizers.blinkid.generic.DependentInfo;


import org.json.JSONArray;
import org.json.JSONException;
Expand Down Expand Up @@ -274,18 +276,21 @@ public static JSONObject serializeStringResult(StringResult stringResult) throws
jsonStringResult.put("latin", stringResult.value(AlphabetType.Latin));
jsonStringResult.put("arabic", stringResult.value(AlphabetType.Arabic));
jsonStringResult.put("cyrillic", stringResult.value(AlphabetType.Cyrillic));
jsonStringResult.put("greek", stringResult.value(AlphabetType.Greek));
jsonStringResult.put("description", stringResult.toString());

JSONObject jsonFieldLocations = new JSONObject();
jsonFieldLocations.put("latin",SerializationUtils.serializeRectangle(stringResult.location(AlphabetType.Latin)));
jsonFieldLocations.put("arabic",SerializationUtils.serializeRectangle(stringResult.location(AlphabetType.Arabic)));
jsonFieldLocations.put("cyrillic",SerializationUtils.serializeRectangle(stringResult.location(AlphabetType.Cyrillic)));
jsonFieldLocations.put("greek", SerializationUtils.serializeRectangle(stringResult.location(AlphabetType.Greek)));
jsonStringResult.put("location", jsonFieldLocations);

JSONObject jsonDocumentSides = new JSONObject();
jsonDocumentSides.put("latin",serializeSide(stringResult.side(AlphabetType.Latin)));
jsonDocumentSides.put("arabic",serializeSide(stringResult.side(AlphabetType.Arabic)));
jsonDocumentSides.put("cyrillic",serializeSide(stringResult.side(AlphabetType.Cyrillic)));
jsonDocumentSides.put("greek", serializeSide(stringResult.side(AlphabetType.Greek)));
jsonStringResult.put("side", jsonDocumentSides);
}
return jsonStringResult;
Expand Down Expand Up @@ -438,4 +443,18 @@ public static CustomClassRules[] deserializeCustomClassRules(JSONArray jsonArray
return new CustomClassRules[]{};
}
}

public static JSONArray serializeDependentInfo (DependentInfo[] dependentInfos) throws JSONException {
JSONArray jsonDependentInfos = new JSONArray();
for (int i = 0; i < dependentInfos.length; ++i) {
JSONObject jsonDependetsInfo = new JSONObject();
jsonDependetsInfo.put("dateOfBirth", BlinkIDSerializationUtils.serializeDateResult(dependentInfos[i].getDateOfBirth()));
jsonDependetsInfo.put("documentNumber",BlinkIDSerializationUtils.serializeStringResult(dependentInfos[i].getDocumentNumber()));
jsonDependetsInfo.put("sex",BlinkIDSerializationUtils.serializeStringResult(dependentInfos[i].getSex()));
jsonDependetsInfo.put("fullName",BlinkIDSerializationUtils.serializeStringResult(dependentInfos[i].getFullName()));
jsonDependetsInfo.put("empty", dependentInfos[i].isEmpty());
jsonDependentInfos.put(jsonDependetsInfo);
}
return jsonDependentInfos;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ public JSONObject serializeResult(Recognizer<?> recognizer) {
jsonResult.put("dateOfExpiry", BlinkIDSerializationUtils.serializeDateResult(result.getDateOfExpiry()));
jsonResult.put("dateOfExpiryPermanent", result.isDateOfExpiryPermanent());
jsonResult.put("dateOfIssue", BlinkIDSerializationUtils.serializeDateResult(result.getDateOfIssue()));
jsonResult.put("dependentsInfo", BlinkIDSerializationUtils.serializeDependentInfo(result.getDependentsInfo()));
jsonResult.put("documentAdditionalNumber", BlinkIDSerializationUtils.serializeStringResult(result.getDocumentAdditionalNumber()));
jsonResult.put("documentNumber", BlinkIDSerializationUtils.serializeStringResult(result.getDocumentNumber()));
jsonResult.put("documentOptionalAdditionalNumber", BlinkIDSerializationUtils.serializeStringResult(result.getDocumentOptionalAdditionalNumber()));
jsonResult.put("documentSubtype", BlinkIDSerializationUtils.serializeStringResult(result.getDocumentSubtype()));
jsonResult.put("driverLicenseDetailedInfo", BlinkIDSerializationUtils.serializeDriverLicenseDetailedInfo(result.getDriverLicenseDetailedInfo()));
jsonResult.put("eligibilityCategory", BlinkIDSerializationUtils.serializeStringResult(result.getEligibilityCategory()));
jsonResult.put("employer", BlinkIDSerializationUtils.serializeStringResult(result.getEmployer()));
jsonResult.put("expired", result.isExpired());
jsonResult.put("faceImage", SerializationUtils.encodeImageBase64(result.getFaceImage()));
Expand All @@ -90,6 +92,7 @@ public JSONObject serializeResult(Recognizer<?> recognizer) {
jsonResult.put("issuingAuthority", BlinkIDSerializationUtils.serializeStringResult(result.getIssuingAuthority()));
jsonResult.put("lastName", BlinkIDSerializationUtils.serializeStringResult(result.getLastName()));
jsonResult.put("localizedName", BlinkIDSerializationUtils.serializeStringResult(result.getLocalizedName()));
jsonResult.put("manufacturingYear", BlinkIDSerializationUtils.serializeStringResult(result.getManufacturingYear()));
jsonResult.put("maritalStatus", BlinkIDSerializationUtils.serializeStringResult(result.getMaritalStatus()));
jsonResult.put("mothersName", BlinkIDSerializationUtils.serializeStringResult(result.getMothersName()));
jsonResult.put("mrzResult", BlinkIDSerializationUtils.serializeMrzResult(result.getMrzResult()));
Expand All @@ -107,7 +110,9 @@ public JSONObject serializeResult(Recognizer<?> recognizer) {
jsonResult.put("scanningFirstSideDone", result.isScanningFirstSideDone());
jsonResult.put("sex", BlinkIDSerializationUtils.serializeStringResult(result.getSex()));
jsonResult.put("signatureImage", SerializationUtils.encodeImageBase64(result.getSignatureImage()));
jsonResult.put("specificDocumentValidity", BlinkIDSerializationUtils.serializeStringResult(result.getSpecificDocumentValidity()));
jsonResult.put("sponsor", BlinkIDSerializationUtils.serializeStringResult(result.getSponsor()));
jsonResult.put("vehicleType", BlinkIDSerializationUtils.serializeStringResult(result.getVehicleType()));
jsonResult.put("visaType", BlinkIDSerializationUtils.serializeStringResult(result.getVisaType()));
} catch (JSONException e) {
// see https://developer.android.com/reference/org/json/JSONException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,13 @@ public JSONObject serializeResult(Recognizer<?> recognizer) {
jsonResult.put("dateOfExpiry", BlinkIDSerializationUtils.serializeDateResult(result.getDateOfExpiry()));
jsonResult.put("dateOfExpiryPermanent", result.isDateOfExpiryPermanent());
jsonResult.put("dateOfIssue", BlinkIDSerializationUtils.serializeDateResult(result.getDateOfIssue()));
jsonResult.put("dependentsInfo", BlinkIDSerializationUtils.serializeDependentInfo(result.getDependentsInfo()));
jsonResult.put("documentAdditionalNumber", BlinkIDSerializationUtils.serializeStringResult(result.getDocumentAdditionalNumber()));
jsonResult.put("documentNumber", BlinkIDSerializationUtils.serializeStringResult(result.getDocumentNumber()));
jsonResult.put("documentOptionalAdditionalNumber", BlinkIDSerializationUtils.serializeStringResult(result.getDocumentOptionalAdditionalNumber()));
jsonResult.put("documentSubtype", BlinkIDSerializationUtils.serializeStringResult(result.getDocumentSubtype()));
jsonResult.put("driverLicenseDetailedInfo", BlinkIDSerializationUtils.serializeDriverLicenseDetailedInfo(result.getDriverLicenseDetailedInfo()));
jsonResult.put("eligibilityCategory", BlinkIDSerializationUtils.serializeStringResult(result.getEligibilityCategory()));
jsonResult.put("employer", BlinkIDSerializationUtils.serializeStringResult(result.getEmployer()));
jsonResult.put("expired", result.isExpired());
jsonResult.put("faceImage", SerializationUtils.encodeImageBase64(result.getFaceImage()));
Expand All @@ -78,6 +80,7 @@ public JSONObject serializeResult(Recognizer<?> recognizer) {
jsonResult.put("issuingAuthority", BlinkIDSerializationUtils.serializeStringResult(result.getIssuingAuthority()));
jsonResult.put("lastName", BlinkIDSerializationUtils.serializeStringResult(result.getLastName()));
jsonResult.put("localizedName", BlinkIDSerializationUtils.serializeStringResult(result.getLocalizedName()));
jsonResult.put("manufacturingYear", BlinkIDSerializationUtils.serializeStringResult(result.getManufacturingYear()));
jsonResult.put("maritalStatus", BlinkIDSerializationUtils.serializeStringResult(result.getMaritalStatus()));
jsonResult.put("mothersName", BlinkIDSerializationUtils.serializeStringResult(result.getMothersName()));
jsonResult.put("mrzResult", BlinkIDSerializationUtils.serializeMrzResult(result.getMrzResult()));
Expand All @@ -94,7 +97,9 @@ public JSONObject serializeResult(Recognizer<?> recognizer) {
jsonResult.put("residentialStatus", BlinkIDSerializationUtils.serializeStringResult(result.getResidentialStatus()));
jsonResult.put("sex", BlinkIDSerializationUtils.serializeStringResult(result.getSex()));
jsonResult.put("signatureImage", SerializationUtils.encodeImageBase64(result.getSignatureImage()));
jsonResult.put("specificDocumentValidity", BlinkIDSerializationUtils.serializeStringResult(result.getSpecificDocumentValidity()));
jsonResult.put("sponsor", BlinkIDSerializationUtils.serializeStringResult(result.getSponsor()));
jsonResult.put("vehicleType", BlinkIDSerializationUtils.serializeStringResult(result.getVehicleType()));
jsonResult.put("visaType", BlinkIDSerializationUtils.serializeStringResult(result.getVisaType()));
jsonResult.put("vizResult", BlinkIDSerializationUtils.serializeVizResult(result.getVizResult()));
} catch (JSONException e) {
Expand Down
2 changes: 1 addition & 1 deletion BlinkID/src/android/libBlinkID.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repositories {
}

dependencies {
implementation('com.microblink:blinkid:6.10.0@aar') {
implementation('com.microblink:blinkid:6.11.1@aar') {
transitive = true
}
}
Expand Down
1 change: 1 addition & 0 deletions BlinkID/src/ios/sources/CDVBlinkIDScanner.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ - (void)scanWithCamera:(CDVInvokedUrlCommand *)command {
MBOverlayViewController *overlayVC = [[MBOverlaySettingsSerializers sharedInstance] createOverlayViewController:jsonOverlaySettings recognizerCollection:self.recognizerCollection delegate:self];

UIViewController<MBRecognizerRunnerViewController>* recognizerRunnerViewController = [MBViewControllerFactory recognizerRunnerViewControllerWithOverlayViewController:overlayVC];
[recognizerRunnerViewController setModalPresentationStyle:UIModalPresentationFullScreen];

self.scanningViewController = recognizerRunnerViewController;

Expand Down
1 change: 1 addition & 0 deletions BlinkID/src/ios/sources/MBBlinkIDSerializationUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@
+(NSNumber * _Nullable)serializeMBSide:(MBSide) value;
+(NSDictionary * _Nonnull) serializeNSDate:(NSDate * _Nullable) value;
+(MBCustomClassRules * _Nonnull) deserializeMBCustomClassRules:(NSDictionary * _Nullable)jsonCustomClassRules;
+(NSMutableArray<NSDictionary *> * _Nullable) serializeDependentInfo:(NSArray<MBDependentInfo *>* _Nullable)dependentInfos;
@end
22 changes: 22 additions & 0 deletions BlinkID/src/ios/sources/MBBlinkIDSerializationUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -362,18 +362,21 @@ + (NSDictionary *)serializeMBStringResult:(MBStringResult *) value {
[dict setValue:[value valueForAlphabetType:MBAlphabetTypeLatin] forKey:@"latin"];
[dict setValue:[value valueForAlphabetType:MBAlphabetTypeArabic] forKey:@"arabic"];
[dict setValue:[value valueForAlphabetType:MBAlphabetTypeCyrillic] forKey:@"cyrillic"];
[dict setValue:[value valueForAlphabetType:MBAlphabetTypeGreek] forKey:@"greek"];
[dict setValue:value.description forKey:@"description"];

NSMutableDictionary *location = [NSMutableDictionary dictionary];
[location setValue:[MBSerializationUtils serializeCGRect:[value locationForAlphabetType:MBAlphabetTypeLatin]] forKey:@"latin"];
[location setValue:[MBSerializationUtils serializeCGRect:[value locationForAlphabetType:MBAlphabetTypeArabic]] forKey:@"arabic"];
[location setValue:[MBSerializationUtils serializeCGRect:[value locationForAlphabetType:MBAlphabetTypeCyrillic]] forKey:@"cyrillic"];
[location setValue:[MBSerializationUtils serializeCGRect:[value locationForAlphabetType:MBAlphabetTypeGreek]] forKey:@"greek"];
[dict setValue:location forKey:@"location"];

NSMutableDictionary *side = [NSMutableDictionary dictionary];
[side setValue:[NSNumber numberWithInteger:[value sideForAlphabetType:MBAlphabetTypeLatin]] forKey:@"latin"];
[side setValue:[NSNumber numberWithInteger:[value sideForAlphabetType:MBAlphabetTypeArabic]] forKey:@"arabic"];
[side setValue:[NSNumber numberWithInteger:[value sideForAlphabetType:MBAlphabetTypeCyrillic]] forKey:@"cyrillic"];
[side setValue:[NSNumber numberWithInteger:[value sideForAlphabetType:MBAlphabetTypeGreek]] forKey:@"greek"];
[dict setValue:side forKey:@"side"];

return dict;
Expand All @@ -386,4 +389,23 @@ +(NSNumber *)serializeMBSide:(MBSide) value {
return [NSNumber numberWithLong:value - 1];
}

+(NSMutableArray<NSDictionary *> *) serializeDependentInfo:(NSArray<MBDependentInfo *>*)dependentInfos {

NSMutableArray<NSDictionary *> * jsonDependentInfos = [[NSMutableArray alloc] init];

for (MBDependentInfo *dependentInfo in dependentInfos) {
NSDictionary *jsonDependentInfo =
@{
@"dateOfBirth": [MBBlinkIDSerializationUtils serializeMBDateResult:(dependentInfo.dateOfBirth)],
@"documentNumber": [MBBlinkIDSerializationUtils serializeMBStringResult:(dependentInfo.documentNumber)],
@"sex": [MBBlinkIDSerializationUtils serializeMBStringResult:(dependentInfo.sex)],
@"fullName": [MBBlinkIDSerializationUtils serializeMBStringResult:(dependentInfo.fullName)],
@"empty":[NSNumber numberWithBool:dependentInfo.empty]
};
[jsonDependentInfos addObject:jsonDependentInfo];
}

return jsonDependentInfos;
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ -(NSDictionary *) serializeResult {
[jsonResult setValue:[MBBlinkIDSerializationUtils serializeMBStringResult:self.result.documentOptionalAdditionalNumber] forKey:@"documentOptionalAdditionalNumber"];
[jsonResult setValue:[MBBlinkIDSerializationUtils serializeMBStringResult:self.result.documentSubtype] forKey:@"documentSubtype"];
[jsonResult setValue:[MBBlinkIDSerializationUtils serializeDriverLicenseDetailedInfo:self.result.driverLicenseDetailedInfo] forKey:@"driverLicenseDetailedInfo"];
[jsonResult setValue:[MBBlinkIDSerializationUtils serializeMBStringResult:self.result.eligibilityCategory] forKey:@"eligibilityCategory"];
[jsonResult setValue:[MBBlinkIDSerializationUtils serializeMBStringResult:self.result.employer] forKey:@"employer"];
[jsonResult setValue:[NSNumber numberWithBool:self.result.expired] forKey:@"expired"];
[jsonResult setValue:[MBSerializationUtils encodeMBImage:self.result.faceImage] forKey:@"faceImage"];
Expand All @@ -238,6 +239,7 @@ -(NSDictionary *) serializeResult {
[jsonResult setValue:[MBBlinkIDSerializationUtils serializeMBStringResult:self.result.issuingAuthority] forKey:@"issuingAuthority"];
[jsonResult setValue:[MBBlinkIDSerializationUtils serializeMBStringResult:self.result.lastName] forKey:@"lastName"];
[jsonResult setValue:[MBBlinkIDSerializationUtils serializeMBStringResult:self.result.localizedName] forKey:@"localizedName"];
[jsonResult setValue:[MBBlinkIDSerializationUtils serializeMBStringResult:self.result.manufacturingYear] forKey:@"manufacturingYear"];
[jsonResult setValue:[MBBlinkIDSerializationUtils serializeMBStringResult:self.result.maritalStatus] forKey:@"maritalStatus"];
[jsonResult setValue:[MBBlinkIDSerializationUtils serializeMBStringResult:self.result.mothersName] forKey:@"mothersName"];
[jsonResult setValue:[MBBlinkIDSerializationUtils serializeMrzResult:self.result.mrzResult] forKey:@"mrzResult"];
Expand All @@ -255,8 +257,11 @@ -(NSDictionary *) serializeResult {
[jsonResult setValue:[NSNumber numberWithBool:self.result.scanningFirstSideDone] forKey:@"scanningFirstSideDone"];
[jsonResult setValue:[MBBlinkIDSerializationUtils serializeMBStringResult:self.result.sex] forKey:@"sex"];
[jsonResult setValue:[MBSerializationUtils encodeMBImage:self.result.signatureImage] forKey:@"signatureImage"];
[jsonResult setValue:[MBBlinkIDSerializationUtils serializeMBStringResult:self.result.specificDocumentValidity] forKey:@"specificDocumentValidity"];
[jsonResult setValue:[MBBlinkIDSerializationUtils serializeMBStringResult:self.result.sponsor] forKey:@"sponsor"];
[jsonResult setValue:[MBBlinkIDSerializationUtils serializeMBStringResult:self.result.vehicleType] forKey:@"vehicleType"];
[jsonResult setValue:[MBBlinkIDSerializationUtils serializeMBStringResult:self.result.visaType] forKey:@"visaType"];
[jsonResult setValue:[MBBlinkIDSerializationUtils serializeDependentInfo:self.result.dependentInfos] forKey:@"dependentsInfo"];

return jsonResult;
}
Expand Down
Loading

0 comments on commit 7d342a9

Please sign in to comment.