Skip to content

Commit 6c29830

Browse files
authored
Merge pull request #17 from blinkcard/release/v2.12.0
Release/v2.12.0
2 parents 904095f + e0f9bfe commit 6c29830

File tree

17 files changed

+253
-187
lines changed

17 files changed

+253
-187
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ xcshareddata
1212
node_modules
1313
.idea
1414

15-
/Sample
15+
/Sample
16+
/BlinkCardSample

BlinkCard/blinkcard-react-native.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ Pod::Spec.new do |s|
1313
s.source = { :git => "https://github.com/BlinkCard/blinkcard-react-native.git", :tag => "v#{s.version}" }
1414
s.source_files = "src/ios", "src/ios/**/*.{h,m}"
1515
s.dependency 'React'
16-
s.dependency 'MBBlinkCard', '~> 2.11.1'
16+
s.dependency 'MBBlinkCard', '~> 2.12.0'
1717
s.frameworks = 'UIKit'
1818
end

BlinkCard/overlays/blinkCardOverlays.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { OverlaySettings } from '../overlaySettings'
2-
import { AndroidCameraResolutionPreset,
3-
iOSCameraResolutionPreset
4-
} from '../types'
2+
import {
3+
AndroidCameraResolutionPreset,
4+
iOSCameraResolutionPreset
5+
} from '../types'
56
/**
67
* Class for setting up BlinkCard overlay.
78
* BlinkCard overlay is best suited for scanning payment cards.
@@ -51,6 +52,12 @@ export class BlinkCardOverlaySettings extends OverlaySettings {
5152
* If null, default value will be used.
5253
*/
5354
this.scanningWrongSideMessage = null;
55+
/**
56+
* String: Instructions for the user when too much tilt is detected.
57+
*
58+
* If null, default value will be used.
59+
*/
60+
this.keepCardParallelMessage = null;
5461
/**
5562
* Defines whether button for presenting onboarding screens will be present on screen
5663
*

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.11.1",
3+
"version": "2.12.0",
44
"description": "AI-driven credit card scanning for cross-platform apps built with ReactNative.",
55
"main": "index.js",
66
"repository": {
Lines changed: 42 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
11
import { Recognizer, RecognizerResult } from '../recognizer'
22
import {
33
Date,
4-
Point,
5-
Quadrilateral,
6-
7-
8-
Issuer,
9-
BlinkCardProcessingStatus,
10-
BlinkCardAnonymizationMode,
11-
CardNumberAnonymizationSettings,
124
BlinkCardAnonymizationSettings,
135
BlinkCardMatchLevel,
14-
BlinkCardCheckResult,
156
ImageExtensionFactors,
16-
DataMatchResult,
7+
BlinkCardDetectionLevel,
178
} from '../types'
189

1910
/**
@@ -22,93 +13,93 @@ import {
2213
export class BlinkCardRecognizerResult extends RecognizerResult {
2314
constructor(nativeResult) {
2415
super(nativeResult.resultState);
25-
16+
2617
/**
2718
* The payment card number.
2819
*/
2920
this.cardNumber = nativeResult.cardNumber;
30-
21+
3122
/**
3223
* The payment card number prefix.
3324
*/
3425
this.cardNumberPrefix = nativeResult.cardNumberPrefix;
35-
26+
3627
/**
3728
* The payment card number is valid
3829
*/
3930
this.cardNumberValid = nativeResult.cardNumberValid;
40-
31+
4132
/**
4233
* Payment card's security code/value.
4334
*/
4435
this.cvv = nativeResult.cvv;
45-
36+
4637
/**
4738
* Document liveness check (screen, photocopy, hand presence) which can pass or fail.
4839
*/
4940
this.documentLivenessCheck = nativeResult.documentLivenessCheck;
50-
41+
5142
/**
5243
* The payment card's expiry date.
5344
*/
5445
this.expiryDate = nativeResult.expiryDate != null ? new Date(nativeResult.expiryDate) : null;
55-
46+
5647
/**
5748
* Whether the first scanned side is anonymized.
5849
*/
5950
this.firstSideAnonymized = nativeResult.firstSideAnonymized;
60-
51+
6152
/**
6253
* Whether the first scanned side is blurred.
6354
*/
6455
this.firstSideBlurred = nativeResult.firstSideBlurred;
65-
56+
6657
/**
6758
* Full image of the payment card from first side recognition.
6859
*/
6960
this.firstSideFullDocumentImage = nativeResult.firstSideFullDocumentImage;
70-
61+
7162
/**
7263
* Payment card's IBAN.
7364
*/
7465
this.iban = nativeResult.iban;
75-
66+
7667
/**
7768
* Payment card's issuing network.
7869
*/
7970
this.issuer = nativeResult.issuer;
80-
71+
8172
/**
8273
* Information about the payment card owner (name, company, etc.).
8374
*/
8475
this.owner = nativeResult.owner;
85-
76+
8677
/**
8778
* Status of the last recognition process.
8879
*/
8980
this.processingStatus = nativeResult.processingStatus;
90-
81+
9182
/**
9283
* Returns true if recognizer has finished scanning first side and is now scanning back side,
9384
* false if it's still scanning first side.
9485
*/
9586
this.scanningFirstSideDone = nativeResult.scanningFirstSideDone;
96-
87+
9788
/**
9889
* Whether the second scanned side is anonymized.
9990
*/
10091
this.secondSideAnonymized = nativeResult.secondSideAnonymized;
101-
92+
10293
/**
10394
* Whether the second scanned side is blurred.
10495
*/
10596
this.secondSideBlurred = nativeResult.secondSideBlurred;
106-
97+
10798
/**
10899
* Full image of the payment card from second side recognition.
109100
*/
110101
this.secondSideFullDocumentImage = nativeResult.secondSideFullDocumentImage;
111-
102+
112103
}
113104
}
114105

@@ -118,86 +109,86 @@ export class BlinkCardRecognizerResult extends RecognizerResult {
118109
export class BlinkCardRecognizer extends Recognizer {
119110
constructor() {
120111
super('BlinkCardRecognizer');
121-
112+
122113
/**
123114
* Defines whether blured frames filtering is allowed
124115
*
125116
*
126117
*/
127118
this.allowBlurFilter = true;
128-
119+
129120
/**
130121
* Whether invalid card number is accepted.
131122
*
132123
*
133124
*/
134125
this.allowInvalidCardNumber = false;
135-
126+
136127
/**
137128
* Defines whether sensitive data should be redacted from the result.
138129
*
139130
*
140131
*/
141132
this.anonymizationSettings = new BlinkCardAnonymizationSettings();
142-
133+
143134
/**
144135
* Should extract CVV
145136
*
146137
*
147138
*/
148139
this.extractCvv = true;
149-
140+
150141
/**
151142
* Should extract the payment card's month of expiry
152143
*
153144
*
154145
*/
155146
this.extractExpiryDate = true;
156-
147+
157148
/**
158149
* Should extract the payment card's IBAN
159150
*
160151
*
161152
*/
162153
this.extractIban = true;
163-
154+
164155
/**
165156
* Should extract the card owner information
166157
*
167158
*
168159
*/
169160
this.extractOwner = true;
170-
161+
171162
/**
172163
* Property for setting DPI for full document images
173164
* Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception
174165
*
175166
*
176167
*/
177168
this.fullDocumentImageDpi = 250;
178-
169+
179170
/**
180171
* Image extension factors for full document image.
181172
*
182173
* @see CImageExtensionFactors
183174
*
184175
*/
185176
this.fullDocumentImageExtensionFactors = new ImageExtensionFactors();
186-
177+
187178
/**
188179
* This parameter is used to adjust heuristics that eliminate cases when the hand is present.
189180
*
190181
*
191182
*/
192183
this.handDocumentOverlapThreshold = 0.05;
193-
184+
194185
/**
195186
* Hand scale is calculated as a ratio between area of hand mask and document mask.
196187
*
197188
*
198189
*/
199190
this.handScaleThreshold = 0.15;
200-
191+
201192
/**
202193
* Pading is a minimum distance from the edge of the frame and is defined as a percentage of the frame width. Default value is 0.0f and in that case
203194
* padding edge and image edge are the same.
@@ -206,28 +197,35 @@ export class BlinkCardRecognizer extends Recognizer {
206197
*
207198
*/
208199
this.paddingEdge = 0.0;
209-
200+
210201
/**
211202
* Photocopy analysis match level - higher if stricter.
212203
*
213204
*
214205
*/
215206
this.photocopyAnalysisMatchLevel = BlinkCardMatchLevel.Level5;
216-
207+
217208
/**
218209
* Sets whether full document image of ID card should be extracted.
219210
*
220211
*
221212
*/
222213
this.returnFullDocumentImage = false;
223-
214+
224215
/**
225216
* Screen analysis match level - higher if stricter.
226217
*
227218
*
228219
*/
229220
this.screenAnalysisMatchLevel = BlinkCardMatchLevel.Level5;
230-
221+
222+
/**
223+
* The level of allowed detected tilt of the document in the image.
224+
*
225+
* Default: `BlinkCardDetectionLevel.Mid`
226+
*/
227+
this.tiltDetectionLevel = BlinkCardDetectionLevel.Mid;
228+
231229
this.createResultFromNative = function (nativeResult) { return new BlinkCardRecognizerResult(nativeResult); }
232230
}
233231
}

BlinkCard/src/android/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
rootProject.allprojects {
22
repositories {
33
google()
4-
jcenter()
54
maven { url 'https://maven.microblink.com' }
65
}
76
}
@@ -25,7 +24,7 @@ android {
2524

2625
dependencies {
2726
implementation 'com.facebook.react:react-native:+'
28-
implementation('com.microblink:blinkcard:2.11.1@aar') {
27+
implementation('com.microblink:blinkcard:2.12.0@aar') {
2928
transitive = true
3029
}
3130
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ public UISettings createUISettings(Context context, ReadableMap jsonUISettings,
6363
if (scanningWrongSideMessage != null) {
6464
overlayStringsBuilder.setErrorScanningWrongSide(scanningWrongSideMessage);
6565
}
66+
67+
String keepCardParallelMessage = getStringFromMap(jsonUISettings, "keepCardParallelMessage");
68+
if (keepCardParallelMessage != null) {
69+
overlayStringsBuilder.setErrorCameraAngleTooSteep(keepCardParallelMessage);
70+
}
6671

6772
VideoResolutionPreset videoResolutionPreset = VideoResolutionPreset.values()[0];
6873
if (jsonUISettings.hasKey("androidCameraResolutionPreset")) {

BlinkCard/src/android/src/main/java/com/microblink/blinkcard/reactnative/recognizers/serialization/BlinkCardRecognizerSerialization.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ public Recognizer<?> createRecognizer(ReadableMap jsonMap) {
5656
if (jsonMap.hasKey("screenAnalysisMatchLevel")) {
5757
recognizer.setScreenAnalysisMatchLevel(BlinkCardSerializationUtils.deserializeMatchLevel(jsonMap.getInt("screenAnalysisMatchLevel")));
5858
}
59+
if(jsonMap.hasKey("tiltDetectionLevel")) {
60+
recognizer.setTiltDetectionLevel(BlinkCardSerializationUtils.deserializeDetectionLevel(jsonMap.getInt("tiltDetectionLevel")));
61+
}
5962
return recognizer;
6063
}
6164

BlinkCard/src/android/src/main/java/com/microblink/blinkcard/reactnative/recognizers/serialization/BlinkCardSerializationUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.microblink.blinkcard.reactnative.recognizers.serialization;
22

3+
import com.microblink.blinkcard.entities.recognizers.blinkcard.DetectionLevel;
34
import com.microblink.blinkcard.reactnative.SerializationUtils;
45

56
import com.microblink.blinkcard.entities.recognizers.blinkcard.BlinkCardAnonymizationMode;
@@ -56,7 +57,6 @@ public static WritableMap serializeDocumentLivenessCheckResult(DocumentLivenessC
5657
return jsonDocumentLivenessCheckResult;
5758
}
5859

59-
public static MatchLevel deserializeMatchLevel(int value) {
60-
return MatchLevel.values()[value];
61-
}
60+
public static MatchLevel deserializeMatchLevel(int value) { return MatchLevel.values()[value]; }
61+
public static DetectionLevel deserializeDetectionLevel(int value) { return DetectionLevel.values()[value]; }
6262
}

0 commit comments

Comments
 (0)