Skip to content

Commit

Permalink
Merge pull request #217 from BlinkID/release/v6.5.0
Browse files Browse the repository at this point in the history
Release/v6.5.0
  • Loading branch information
mparadina authored Feb 21, 2024
2 parents 68bc5b6 + 7697118 commit 006d9d5
Show file tree
Hide file tree
Showing 12 changed files with 253 additions and 216 deletions.
2 changes: 1 addition & 1 deletion BlinkID/blinkid-react-native.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Pod::Spec.new do |s|
s.header_dir = "blinkid-react-native"

s.dependency 'React'
s.dependency 'PPBlinkID', '~> 6.4.0'
s.dependency 'PPBlinkID', '~> 6.5.0'

s.frameworks = 'UIKit'
end
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-react-native",
"version": "6.4.0",
"version": "6.5.0",
"description": "A small and powerful ID card scanning library. Powered by Microblink (www.microblink.com).",
"main": "index.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion BlinkID/src/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ android {

dependencies {
implementation 'com.facebook.react:react-native:+'
implementation('com.microblink:blinkid:6.4.0@aar') {
implementation('com.microblink:blinkid:6.5.0@aar') {
transitive = true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.microblink.blinkid.intent.IntentDataTransferMode;
import com.microblink.blinkid.reactnative.overlays.OverlaySettingsSerializers;
import com.microblink.blinkid.uisettings.ActivityRunner;
import com.microblink.blinkid.locale.LanguageUtils;

import com.microblink.blinkid.uisettings.UISettings;
import com.microblink.blinkid.reactnative.recognizers.RecognizerSerializers;
Expand Down Expand Up @@ -60,7 +61,11 @@ public String getName() {
@ReactMethod
public void scanWithCamera(ReadableMap jsonOverlaySettings, ReadableMap jsonRecognizerCollection, ReadableMap license, Promise promise) {
prepareScanning(license, promise);

try {
LanguageUtils.setLanguageAndCountry(jsonOverlaySettings.getString("language"),
jsonOverlaySettings.getString("country"),
getCurrentActivity());
} catch (Exception e) {}
mRecognizerBundle = RecognizerSerializers.INSTANCE.deserializeRecognizerCollection(jsonRecognizerCollection);
UISettings overlaySettings = OverlaySettingsSerializers.INSTANCE.getOverlaySettings(getReactApplicationContext(), jsonOverlaySettings, mRecognizerBundle);
ActivityRunner.startActivityForResult(getCurrentActivity(), REQUEST_CODE, overlaySettings);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ public static WritableMap serializeImageAnalysisResult(ImageAnalysisResult image
jsonImageAnalysis.putInt("mrzDetectionStatus", SerializationUtils.serializeEnum(imageAnalysisResult.getMrzDetectionStatus()));
jsonImageAnalysis.putInt("barcodeDetectionStatus", SerializationUtils.serializeEnum(imageAnalysisResult.getBarcodeDetectionStatus()));
jsonImageAnalysis.putInt("cardRotation", BlinkIDSerializationUtils.serializeCardRotation(imageAnalysisResult.getCardRotation()));
jsonImageAnalysis.putInt("cardOrientation", SerializationUtils.serializeEnum(imageAnalysisResult.getCardOrientation()));
return jsonImageAnalysis;
}

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ - (NSDictionary *)sanitizeDictionary:(NSDictionary *)dictionary {
[[MBMicroblinkSDK sharedInstance] setLicenseKey:iosLicense errorCallback:^(MBLicenseError licenseError) {
}];
}

if (jsonOverlaySettings[@"language"] != nil) {
if (jsonOverlaySettings[@"country"] != nil && ![jsonOverlaySettings[@"country"] isEqual: @""]) {
MBMicroblinkApp.sharedInstance.language = [[(NSString *)jsonOverlaySettings[@"language"] stringByAppendingString:@"-" ] stringByAppendingString:(NSString *)jsonOverlaySettings[@"country"]];
} else {
MBMicroblinkApp.sharedInstance.language = jsonOverlaySettings[@"language"];
}
}

self.recognizerCollection = [[MBRecognizerSerializers sharedInstance] deserializeRecognizerCollection:jsonRecognizerCollection];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ +(NSDictionary *) serializeImageAnalysisResult:(MBImageAnalysisResult *)imageAna
@"faceDetectionStatus" : [NSNumber numberWithInteger:(imageAnalysisResult.faceDetectionStatus)],
@"mrzDetectionStatus" : [NSNumber numberWithInteger:(imageAnalysisResult.mrzDetectionStatus)],
@"barcodeDetectionStatus" : [NSNumber numberWithInteger:(imageAnalysisResult.barcodeDetectionStatus)],
@"cardRotation" : [NSNumber numberWithInteger:(imageAnalysisResult.cardRotation)]
@"cardRotation" : [NSNumber numberWithInteger:(imageAnalysisResult.cardRotation)],
@"cardOrientation" : [NSNumber numberWithInteger:(imageAnalysisResult.cardOrientation)]
};
}

Expand Down Expand Up @@ -249,19 +250,19 @@ +(MBClassAnonymizationSettings *) deserializeMBClassAnonymizationSettings:(NSDic
NSNumber *region = [jsonClassAnonymizationSettings valueForKey:@"region"];
NSNumber *type = [jsonClassAnonymizationSettings valueForKey:@"type"];

if (![country isEqual:[NSNull null]] && ![region isEqual:[NSNull null]] && ![type isEqual:[NSNull null]]) {
if (![country isEqual:[NSNull null]] && country.integerValue != nil && ![region isEqual:[NSNull null]] && region.integerValue != nil && ![type isEqual:[NSNull null]] && type.integerValue != nil) {
return [[MBClassAnonymizationSettings alloc] initWithCountry:country.integerValue region:region.integerValue type:type.integerValue fields:fields];
} else if (![country isEqual:[NSNull null]] && ![type isEqual:[NSNull null]]) {
} else if (![country isEqual:[NSNull null]] && country.integerValue != nil && ![type isEqual:[NSNull null]] && type.integerValue != nil){
return [[MBClassAnonymizationSettings alloc] initWithCountry:country.integerValue type:type.integerValue fields:fields];
} else if (![country isEqual:[NSNull null]] && ![region isEqual:[NSNull null]] ) {
} else if (![country isEqual:[NSNull null]] && country.integerValue != nil && ![region isEqual:[NSNull null]] && region.integerValue != nil ) {
return [[MBClassAnonymizationSettings alloc] initWithCountry:country.integerValue region:region.integerValue fields:fields];
} else if (![region isEqual:[NSNull null]] && ![type isEqual:[NSNull null]]) {
return [[MBClassAnonymizationSettings alloc] initWithRegion:region.integerValue type:type.integerValue fields:fields];
} else if (![country isEqual:[NSNull null]]) {
} else if (![region isEqual:[NSNull null]] && region.integerValue != nil && ![type isEqual:[NSNull null]] && type.integerValue != nil ) {
return [[MBClassAnonymizationSettings alloc] initWithRegion:region.integerValue type:type.integerValue fields:fields];
} else if (![country isEqual:[NSNull null]] && country.integerValue != nil ) {
return [[MBClassAnonymizationSettings alloc] initWithCountry:country.integerValue fields:fields];
} else if (![region isEqual:[NSNull null]] ) {
} else if (![region isEqual:[NSNull null]] && region.integerValue != nil) {
return [[MBClassAnonymizationSettings alloc] initWithRegion:region.integerValue fields:fields];
} else if (![type isEqual:[NSNull null]]) {
} else if (![type isEqual:[NSNull null]] && type.integerValue != nil ) {
return [[MBClassAnonymizationSettings alloc] initWithType:type.integerValue fields:fields];
}

Expand Down
16 changes: 16 additions & 0 deletions BlinkID/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,22 @@ export const CardRotation = Object.freeze(
}
);

/**
* Defines possible card orientations
*/
export const CardOrientation = Object.freeze(
{
/** Horizontal card orientation */
Horizontal: 0,

/** Vertical card orientation */
Vertical: 1,

/** Detection was not performed */
NotAvailable: 2,
}
);

/**
* Defines possible color and moire statuses determined from scanned image.
*/
Expand Down
6 changes: 6 additions & 0 deletions Release notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 6.5.0

- We have updated the plugin to [Android SDK v6.5.0](https://github.com/BlinkID/blinkid-android/releases/tag/v6.5.0) and [iOS SDK v6.5.0](https://github.com/BlinkID/blinkid-ios/releases/tag/v6.5.0)
- Added `cardOrientation` property to `ImageAnalysisResult`
- Fixed issue with the SDK localization

## 6.4.0

We have updated plugin to [Android SDK v6.4.0](https://github.com/BlinkID/blinkid-android/releases/tag/v6.4.0) and [iOS SDK v6.4.0](https://github.com/BlinkID/blinkid-ios/releases/tag/v6.4.0)
Expand Down
2 changes: 1 addition & 1 deletion initReactNativeSampleApp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ "$IS_LOCAL_BUILD" = true ]; then
# use directly source code from this repo instead of npm package
# from RN 0.57 symlink does not work any more
npm pack $blink_id_plugin_path
npm install --save blinkid-react-native-6.4.0.tgz
npm install --save blinkid-react-native-6.5.0.tgz
#pushd node_modules
#ln -s $blink_id_plugin_path blinkid-react-native
#popd
Expand Down
4 changes: 2 additions & 2 deletions sample_files/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import {

const licenseKey = Platform.select({
// iOS license key for applicationID: com.microblink.sample
ios: 'sRwCABVjb20ubWljcm9ibGluay5zYW1wbGUBbGV5SkRjbVZoZEdWa1QyNGlPakUzTURNd056Y3hORFkzT1RJc0lrTnlaV0YwWldSR2IzSWlPaUkwT1RabFpEQXpaUzAwT0RBeExUUXpZV1F0WVRrMU5DMDBNemMyWlRObU9UTTVNR1FpZlE9PYPwAuE88FDjP95RyiGUewj+e6SGUoHitmTt0i2T87nVbH79ynAtPdmuQV49+U4ulln6j4ku3momxVE2igI9howeOZwxK5IbpMVG3ooDibChEXUccclpCCv08w3gEUwsP7hGOIBbA4HP45vru2nkan74SUYXWVU=',
ios: 'sRwCABVjb20ubWljcm9ibGluay5zYW1wbGUBbGV5SkRjbVZoZEdWa1QyNGlPakUzTURnd09EUTFNamM1TnpJc0lrTnlaV0YwWldSR2IzSWlPaUkwT1RabFpEQXpaUzAwT0RBeExUUXpZV1F0WVRrMU5DMDBNemMyWlRObU9UTTVNR1FpZlE9PTYmqMAMVMiFzaNDv15W9/CxDFVRDWRjok+uP0GtswDV4XTVGmhbivKDEb9Gtk2iMzf29qFWF8aUjIES4QSQFJG0xfBXZhluSk7lt4A959aHAZ0+BWgDnqZUPJAF2jZd0Pl2Kt1oDxLtqtf8V/RR+dPYzUV0PEA=',
// android license key for applicationID: com.microblink.sample
android: 'sRwCABVjb20ubWljcm9ibGluay5zYW1wbGUAbGV5SkRjbVZoZEdWa1QyNGlPakUzTURNd056Y3lNRE0xTWpnc0lrTnlaV0YwWldSR2IzSWlPaUkwT1RabFpEQXpaUzAwT0RBeExUUXpZV1F0WVRrMU5DMDBNemMyWlRObU9UTTVNR1FpZlE9PY6A6Eq56GBOfiH4PZYVCf1vcY3/GuHCOkdOhF5rUKHodDOB3Q01339g0q22TM/fWv5f06CvIiAamEhg1m8xAYWSQt2VVSsVJaAncz+bGexcASnuhlHA+LTLnSZGIxSgnNKBJbizQypDRsyFKKpBq7K2SfVi+gM='
android: 'sRwCABVjb20ubWljcm9ibGluay5zYW1wbGUAbGV5SkRjbVZoZEdWa1QyNGlPakUzTURnd09EUTNNelkxTmprc0lrTnlaV0YwWldSR2IzSWlPaUkwT1RabFpEQXpaUzAwT0RBeExUUXpZV1F0WVRrMU5DMDBNemMyWlRObU9UTTVNR1FpZlE9PRIv5OawGAVdpvmuz+999CsJyIAgtV3h96BJo1Fq+xBZnKDoKhL01jBUrxC0E4+EeWoTuEtPPcDte2KHgjOP7Z4y+Mk9ihWDHTjgANWfFwG2Gd7HYJxgwcYQsTvICqS1CBklIILTfbXahwtD4ZKh0ghaxUJf7gU='
})

var renderIf = function(condition, content) {
Expand Down

0 comments on commit 006d9d5

Please sign in to comment.