Skip to content

Commit 0185b9a

Browse files
authored
Merge pull request #14 from blinkcard/release/v2.10.1
Release/v2.10.1
2 parents da0e04e + bd7e187 commit 0185b9a

File tree

8 files changed

+157
-150
lines changed

8 files changed

+157
-150
lines changed

BlinkCard/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

BlinkCard/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@microblink/blinkcard-react-native",
3-
"version": "2.10.0",
3+
"version": "2.10.1",
44
"description": "AI-driven credit card scanning for cross-platform apps built with ReactNative.",
55
"main": "index.js",
66
"repository": {

BlinkCard/src/android/src/main/java/com/microblink/blinkcard/reactnative/overlays/serialization/BlinkCardOverlaySettingsSerialization.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public UISettings createUISettings(Context context, ReadableMap jsonUISettings,
5959
if (errorCardTooCloseToEdge != null) {
6060
overlayStringsBuilder.setErrorCardTooCloseToEdge(errorCardTooCloseToEdge);
6161
}
62-
62+
6363
VideoResolutionPreset videoResolutionPreset = VideoResolutionPreset.values()[0];
6464
if (jsonUISettings.hasKey("androidCameraResolutionPreset")) {
6565
videoResolutionPreset = VideoResolutionPreset.values()[jsonUISettings.getInt("androidCameraResolutionPreset")];

BlinkCard/src/ios/MicroblinkModule/MicroblinkModule.xcodeproj/project.pbxproj

Lines changed: 119 additions & 119 deletions
Large diffs are not rendered by default.

BlinkCard/src/ios/MicroblinkModule/MicroblinkModule/MBCBlinkCardModule.m

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#import "MBCOverlaySettingsSerializers.h"
44
#import "MBCRecognizerWrapper.h"
55
#import "MBCSerializationUtils.h"
6-
76
#import <Foundation/Foundation.h>
87
#import "MBCBlinkCardModule.h"
98
#import <React/RCTConvert.h>
@@ -19,12 +18,13 @@ typedef NS_ENUM(NSUInteger, PPImageType) {
1918
static NSString* const MBCErrorDomain = @"microblink.error";
2019
static NSString* const RESULT_CAPTURED_FULL_IMAGE = @"capturedFullImage";
2120
static NSString* const RESULT_DOCUMENT_CAPTURE_RECOGNIZER_RESULT = @"documentCaptureRecognizerResult";
22-
2321
@interface MBCBlinkCardModule () <MBCOverlayViewControllerDelegate, MBCScanningRecognizerRunnerDelegate, MBCFirstSideFinishedRecognizerRunnerDelegate>
2422

2523
@property (nonatomic, strong) MBCRecognizerCollection *recognizerCollection;
2624
@property (nonatomic) id<MBCRecognizerRunnerViewController> scanningViewController;
2725
@property (nonatomic, strong) MBCRecognizerRunner *recognizerRunner;
26+
@property (nonatomic, strong) MBCOverlayViewController *overlayVc;
27+
@property (nonatomic, strong) NSDictionary *recognizerCollectionDict;
2828
@property (nonatomic, strong) NSDictionary *backImageBase64Image;
2929

3030
@property (class, nonatomic, readonly) NSString *STATUS_SCAN_CANCELED;
@@ -55,7 +55,7 @@ + (BOOL)requiresMainQueueSetup {
5555

5656
/**
5757
Method sanitizes the dictionary replaces all occurances of NSNull with nil
58-
58+
5959
@param dictionary JSON objects
6060
@return new dictionary with NSNull values replaced with nil
6161
*/
@@ -70,26 +70,27 @@ - (NSDictionary *)sanitizeDictionary:(NSDictionary *)dictionary {
7070
}
7171

7272
RCT_REMAP_METHOD(scanWithCamera, scanWithCamera:(NSDictionary *)jsonOverlaySettings recognizerCollection:(NSDictionary *)jsonRecognizerCollection license:(NSDictionary *)jsonLicense resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
73-
73+
7474
// Sanitize the dictionaries
7575
jsonOverlaySettings = [self sanitizeDictionary:jsonOverlaySettings];
7676
jsonRecognizerCollection = [self sanitizeDictionary:jsonRecognizerCollection];
77+
_recognizerCollectionDict = jsonRecognizerCollection;
7778
jsonLicense = [self sanitizeDictionary:jsonLicense];
7879

7980
self.promiseResolve = resolve;
8081
self.promiseReject = reject;
8182

8283
if([self setupLicense:jsonLicense]) {
8384
[self setupLanguage:jsonOverlaySettings];
84-
85+
8586
self.recognizerCollection = [[MBCRecognizerSerializers sharedInstance] deserializeRecognizerCollection:jsonRecognizerCollection];
86-
8787
dispatch_sync(dispatch_get_main_queue(), ^{
88-
MBCOverlayViewController *overlayVC = [[MBCOverlaySettingsSerializers sharedInstance] createOverlayViewController:jsonOverlaySettings recognizerCollection:self.recognizerCollection delegate:self];
89-
90-
UIViewController<MBCRecognizerRunnerViewController>* recognizerRunnerViewController = [MBCViewControllerFactory recognizerRunnerViewControllerWithOverlayViewController:overlayVC];
88+
_overlayVc = [[MBCOverlaySettingsSerializers sharedInstance] createOverlayViewController:jsonOverlaySettings recognizerCollection:self.recognizerCollection delegate:self];
89+
90+
UIViewController<MBCRecognizerRunnerViewController>* recognizerRunnerViewController = [MBCViewControllerFactory recognizerRunnerViewControllerWithOverlayViewController:_overlayVc];
91+
[recognizerRunnerViewController setModalPresentationStyle:UIModalPresentationFullScreen];
9192
self.scanningViewController = recognizerRunnerViewController;
92-
93+
9394
UIViewController *rootViewController = [[[UIApplication sharedApplication] keyWindow] rootViewController];
9495
[rootViewController presentViewController:self.scanningViewController animated:YES completion:nil];
9596
});
@@ -125,25 +126,25 @@ - (void)overlayViewControllerDidFinishScanning:(MBCOverlayViewController *)overl
125126
if (state != MBCRecognizerResultStateEmpty) {
126127
[overlayViewController.recognizerRunnerViewController pauseScanning];
127128
// recognizers within self.recognizerCollection now have their results filled
128-
129+
129130
BOOL isDocumentCaptureRecognizer = NO;
130-
131+
131132
NSMutableArray *jsonResults = [[NSMutableArray alloc] initWithCapacity:self.recognizerCollection.recognizerList.count];
132-
133+
133134
for (NSUInteger i = 0; i < self.recognizerCollection.recognizerList.count; ++i) {
134135
[jsonResults addObject:[[self.recognizerCollection.recognizerList objectAtIndex:i] serializeResult]];
135-
136-
if (!isDocumentCaptureRecognizer) {
137-
self.promiseResolve(jsonResults);
138-
}
139-
// dismiss recognizer runner view controller
140-
dispatch_async(dispatch_get_main_queue(), ^{
141-
UIViewController *rootViewController = [[[UIApplication sharedApplication] keyWindow] rootViewController];
142-
[rootViewController dismissViewControllerAnimated:YES completion:nil];
143-
self.recognizerCollection = nil;
144-
self.scanningViewController = nil;
145-
self.promiseResolve = nil;
146-
self.promiseReject = nil;
136+
137+
if (!isDocumentCaptureRecognizer) {
138+
self.promiseResolve(jsonResults);
139+
}
140+
// dismiss recognizer runner view controller
141+
dispatch_async(dispatch_get_main_queue(), ^{
142+
UIViewController *rootViewController = [[[UIApplication sharedApplication] keyWindow] rootViewController];
143+
[rootViewController dismissViewControllerAnimated:YES completion:nil];
144+
self.recognizerCollection = nil;
145+
self.scanningViewController = nil;
146+
self.promiseResolve = nil;
147+
self.promiseReject = nil;
147148
});
148149
}
149150
}
@@ -158,7 +159,7 @@ - (void)overlayDidTapClose:(MBCOverlayViewController *)overlayViewController {
158159
code:-58
159160
userInfo:nil];
160161
self.promiseReject(MBCBlinkCardModule.STATUS_SCAN_CANCELED, @"Scanning has been canceled", error);
161-
162+
162163
self.promiseResolve = nil;
163164
self.promiseReject = nil;
164165
}

BlinkCard/src/ios/MicroblinkModule/MicroblinkModule/Overlays/Serialization/MBCBlinkCardOverlaySettingsSerialization.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,4 @@ - (void)blinkCardOverlayViewControllerDidTapClose:(nonnull MBCBlinkCardOverlayVi
122122
[self.delegate overlayDidTapClose:blinkCardOverlayViewController];
123123
}
124124

125-
@end
125+
@end

Release notes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 2.10.1
2+
3+
- Added missing camera presets for both Android and iOS camera settings.
4+
- iOS-specific
5+
- Switched the modal presentation style to full screen.
6+
17
## 2.10.0
28

39
- Updated to [Android SDK v2.10.0](https://github.com/blinkcard/blinkcard-android/releases/tag/v2.10.0) and [iOS SDK v2.10.0](https://github.com/BlinkCard/blinkcard-ios/releases/tag/v2.10.0)

initReactNativeSampleApp.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if [ "$IS_LOCAL_BUILD" = true ]; then
1919
# use directly source code from this repo instead of npm package
2020
# from RN 0.57 symlink does not work any more
2121
npm pack $blink_card_plugin_path
22-
npm install --save microblink-blinkcard-react-native-2.10.0.tgz
22+
npm install --save microblink-blinkcard-react-native-2.10.1.tgz
2323
#pushd node_modules
2424
#ln -s $blinkcard_plugin_path blinkcard-react-native
2525
#popd

0 commit comments

Comments
 (0)