react-native-scanbot-barcode-scanner-sdk 3.2.1-beta1 → 3.2.1-beta2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule.java +6 -0
- package/ios/Utils/BarcodeMapping.h +1 -0
- package/package.json +1 -1
- package/src/result.ts +5 -0
- package/ios/Utils/UpcExtensionBarcodeFilter.h +0 -17
- package/ios/Utils/UpcExtensionBarcodeFilter.m +0 -12
package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule.java
CHANGED
|
@@ -46,6 +46,7 @@ import io.scanbot.sdk.barcode_scanner.ScanbotBarcodeScannerSDKInitializer;
|
|
|
46
46
|
import io.scanbot.sdk.ui.barcode_scanner.view.barcode.BarcodeScannerActivity;
|
|
47
47
|
import io.scanbot.sdk.ui.barcode_scanner.view.barcode.batch.BatchBarcodeScannerActivity;
|
|
48
48
|
import io.scanbot.sdk.ui.view.barcode.batch.configuration.BatchBarcodeScannerConfiguration;
|
|
49
|
+
import io.scanbot.sdk.ui.view.barcode.configuration.BarcodeExtensionsFilter;
|
|
49
50
|
import io.scanbot.sdk.ui.view.barcode.configuration.BarcodeScannerAdditionalConfiguration;
|
|
50
51
|
import io.scanbot.sdk.ui.view.barcode.configuration.BarcodeScannerConfiguration;
|
|
51
52
|
import io.scanbot.sdk.ui.view.base.configuration.CameraOrientationMode;
|
|
@@ -306,6 +307,10 @@ public class ScanbotBarcodeSdkModule extends ReactContextBaseJavaModule implemen
|
|
|
306
307
|
if (options.hasKey("replaceCancelButtonWithIcon") && options.getBoolean("replaceCancelButtonWithIcon")) {
|
|
307
308
|
configuration.setCancelButtonIcon(R.drawable.ic_baseline_arrow_back_24);
|
|
308
309
|
}
|
|
310
|
+
|
|
311
|
+
if (options.hasKey("onlyAcceptCodesWithExtensions") && options.getBoolean("onlyAcceptCodesWithExtensions")) {
|
|
312
|
+
configuration.setBarcodeFilter(new BarcodeExtensionsFilter());
|
|
313
|
+
}
|
|
309
314
|
}
|
|
310
315
|
|
|
311
316
|
@ReactMethod
|
|
@@ -400,6 +405,7 @@ public class ScanbotBarcodeSdkModule extends ReactContextBaseJavaModule implemen
|
|
|
400
405
|
final WritableMap barcode = Arguments.createMap();
|
|
401
406
|
barcode.putString("type", barcodeItem.getBarcodeFormat().name());
|
|
402
407
|
barcode.putString("text", barcodeItem.getText());
|
|
408
|
+
barcode.putString("textWithExtension", barcodeItem.getTextWithExtension());
|
|
403
409
|
barcodes.pushMap(barcode);
|
|
404
410
|
}
|
|
405
411
|
}
|
|
@@ -63,6 +63,7 @@ static inline NSDictionary<NSString*, NSObject*>* jsonFromBarcodeResult(SBSDKBar
|
|
|
63
63
|
NSMutableDictionary* x = @{
|
|
64
64
|
@"type": stringFromBarcodeType(result.type),
|
|
65
65
|
@"text": result.rawTextString,
|
|
66
|
+
@"textWithExtension": result.rawTextStringWithExtension,
|
|
66
67
|
}.mutableCopy;
|
|
67
68
|
return x.copy;
|
|
68
69
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-scanbot-barcode-scanner-sdk",
|
|
3
3
|
"title": "Scanbot Barcode Scanner SDK for React Native",
|
|
4
|
-
"version": "3.2.1-
|
|
4
|
+
"version": "3.2.1-beta2",
|
|
5
5
|
"description": "Scanbot Barcode Scanner SDK React Native Plugin for Android and iOS",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"files": [
|
package/src/result.ts
CHANGED
|
@@ -10,6 +10,11 @@ export interface BarcodeResultField {
|
|
|
10
10
|
* The raw text encoded in the barcode.
|
|
11
11
|
*/
|
|
12
12
|
text: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The raw text encoded in the barcode that also includes the extension, if detected
|
|
16
|
+
*/
|
|
17
|
+
textWithExtension: string;
|
|
13
18
|
}
|
|
14
19
|
|
|
15
20
|
export interface BarcodeResult {
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// UpcExtensionBarcodeFilter.h
|
|
3
|
-
// RNScanbotBarcodeSDK
|
|
4
|
-
//
|
|
5
|
-
// Created by Marco Saia on 08.07.22.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
#import <Foundation/Foundation.h>
|
|
9
|
-
@import ScanbotBarcodeScannerSDK;
|
|
10
|
-
|
|
11
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
12
|
-
|
|
13
|
-
@interface UpcExtensionBarcodeFilter : SBSDKUIBarcodeExtensionsFilter
|
|
14
|
-
|
|
15
|
-
@end
|
|
16
|
-
|
|
17
|
-
NS_ASSUME_NONNULL_END
|