react-native-scanbot-barcode-scanner-sdk 4.0.4 → 4.2.0-beta.2
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/LICENSE +1 -1
- package/Libraries.txt +85 -419
- package/RNScanbotBarcodeSDK.podspec +3 -3
- package/android/build.gradle +12 -13
- package/android/src/main/AndroidManifest.xml +2 -2
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule.kt +179 -0
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkPackage.kt +23 -0
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkPluginResultDelegate.kt +23 -0
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraView.java +79 -70
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/extensions/JSONObject.kt +90 -0
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/extensions/ReadableMap.kt +53 -0
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/JSONUtils.kt +24 -0
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/ScanbotViewUtils.java +4 -0
- package/android/src/new-architecture/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewManager.java +0 -2
- package/index.d.ts +24 -29
- package/index.js +9 -2
- package/ios/Components/BarcodeCameraView/NewArchitecture/RTNScanbotBarcodeCameraView.h +0 -1
- package/ios/Components/BarcodeCameraView/NewArchitecture/RTNScanbotBarcodeCameraView.mm +120 -148
- package/ios/Components/BarcodeCameraView/OldArchitecture/RNScanbotBarcodeCameraView.h +0 -31
- package/ios/Components/BarcodeCameraView/OldArchitecture/RNScanbotBarcodeCameraView.mm +45 -158
- package/ios/Components/BarcodeCameraView/OldArchitecture/RNScanbotBarcodeCameraViewManager.mm +0 -1
- package/ios/ScanbotBarcodeSdk.h +1 -12
- package/ios/ScanbotBarcodeSdk.m +64 -489
- package/ios/ScanbotBarcodeSdkPluginResultDelegate.h +18 -0
- package/ios/ScanbotBarcodeSdkPluginResultDelegate.m +36 -0
- package/js/{RTNScanbotBarcodeCameraViewNativeComponent.tsx → RTNScanbotBarcodeCameraViewNativeComponent.ts} +7 -35
- package/package.json +5 -2
- package/src/components/barcode-camera-view/{scanbot-barcode-camera-view-types.tsx → scanbot-barcode-camera-view-types.ts} +57 -16
- package/src/components/barcode-camera-view/scanbot-barcode-camera-view.tsx +14 -4
- package/src/configurations.ts +374 -0
- package/src/customConfigurations.ts +97 -0
- package/src/customResults.ts +6 -0
- package/src/customTypes.ts +10 -0
- package/src/results.ts +38 -0
- package/src/types.ts +1355 -0
- package/android/.project +0 -34
- package/android/.settings/org.eclipse.buildship.core.prefs +0 -13
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -5
- package/android/gradlew +0 -185
- package/android/gradlew.bat +0 -89
- package/android/src/main/java/com/reactlibrary/ScanbotBarcodeSdkModule.java +0 -19
- package/android/src/main/java/com/reactlibrary/ScanbotBarcodeSdkPackage.java +0 -38
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ObjectMapper.java +0 -166
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkConfiguration.java +0 -75
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule.java +0 -460
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkPackage.java +0 -36
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/StorageUtils.java +0 -108
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/barcode/ScanbotBarcodeDetectorAdditionalConfigBuilder.java +0 -37
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/barcode/ScanbotBarcodeDetectorConfigBuilder.java +0 -45
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewConfiguration.java +0 -195
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/filters/ReactBarcodeExtensionsFilter.java +0 -59
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/JSONUtils.java +0 -440
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/LogUtils.java +0 -43
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/ResponseUtils.java +0 -33
- package/android/src/main/res/drawable/ic_baseline_arrow_back_24.xml +0 -10
- package/android/src/main/res/values/attrs.xml +0 -5
- package/ios/Categories/SBSDKPolygon+JSON.h +0 -16
- package/ios/Categories/SBSDKPolygon+JSON.m +0 -21
- package/ios/Categories/UIColor+JSON.h +0 -14
- package/ios/Categories/UIColor+JSON.m +0 -61
- package/ios/ScanbotBarcodeSDKConfiguration.h +0 -15
- package/ios/ScanbotBarcodeSDKConfiguration.m +0 -13
- package/ios/ScanbotBarcodeSdk.xcodeproj/project.pbxproj +0 -271
- package/ios/ScanbotBarcodeSdk.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/ScanbotBarcodeSdk.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/SharedConfiguration.h +0 -18
- package/ios/SharedConfiguration.m +0 -20
- package/ios/Utils/BarcodeMapping.h +0 -336
- package/ios/Utils/HashUtils.h +0 -46
- package/ios/Utils/JSONMappings.h +0 -25
- package/ios/Utils/LoggingUtils.h +0 -23
- package/ios/Utils/ObjectMapper.h +0 -26
- package/ios/Utils/ObjectMapper.m +0 -143
- package/ios/Utils/ReactBarcodeExtensionsFilter.h +0 -22
- package/ios/Utils/ReactBarcodeExtensionsFilter.m +0 -55
- package/ios/Utils/ScanbotStorageUtils.h +0 -25
- package/ios/Utils/ScanbotStorageUtils.m +0 -111
- package/src/configuration.ts +0 -328
- package/src/enum.ts +0 -106
- package/src/model.ts +0 -104
- package/src/result.ts +0 -45
- /package/src/components/barcode-camera-view/{scanbot-native-barcode-camera-view.tsx → scanbot-native-barcode-camera-view.ts} +0 -0
package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/extensions/ReadableMap.kt
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
package io.scanbot.barcodesdk.plugin.reactnative.extensions
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReadableArray
|
|
4
|
+
import com.facebook.react.bridge.ReadableMap
|
|
5
|
+
import com.facebook.react.bridge.ReadableType
|
|
6
|
+
import org.json.JSONArray
|
|
7
|
+
import org.json.JSONException
|
|
8
|
+
import org.json.JSONObject
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@Throws(JSONException::class)
|
|
12
|
+
fun ReadableMap.toJSON(): JSONObject {
|
|
13
|
+
val jsonResult = JSONObject()
|
|
14
|
+
|
|
15
|
+
val iterator = this.keySetIterator()
|
|
16
|
+
|
|
17
|
+
while (iterator.hasNextKey()) {
|
|
18
|
+
val key = iterator.nextKey()
|
|
19
|
+
|
|
20
|
+
when (this.getType(key)) {
|
|
21
|
+
ReadableType.Boolean -> jsonResult.put(key, this.getBoolean(key))
|
|
22
|
+
ReadableType.Number -> jsonResult.put(key, this.getDouble(key))
|
|
23
|
+
ReadableType.String -> jsonResult.put(key, this.getString(key))
|
|
24
|
+
ReadableType.Map -> jsonResult.put(key, this.getMap(key)?.toJSON())
|
|
25
|
+
ReadableType.Array -> jsonResult.put(key, this.getArray(key)?.toJSONArray())
|
|
26
|
+
ReadableType.Null -> {
|
|
27
|
+
// NO-OP
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return jsonResult
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@Throws(JSONException::class)
|
|
36
|
+
fun ReadableArray.toJSONArray(): JSONArray {
|
|
37
|
+
val jsonResult = JSONArray()
|
|
38
|
+
|
|
39
|
+
for (i in 0 until this.size()) {
|
|
40
|
+
when (this.getType(i)) {
|
|
41
|
+
ReadableType.Boolean -> jsonResult.put(this.getBoolean(i))
|
|
42
|
+
ReadableType.Number -> jsonResult.put(this.getDouble(i))
|
|
43
|
+
ReadableType.String -> jsonResult.put(this.getString(i))
|
|
44
|
+
ReadableType.Map -> jsonResult.put(this.getMap(i).toJSON())
|
|
45
|
+
ReadableType.Array -> jsonResult.put(this.getArray(i).toJSONArray())
|
|
46
|
+
ReadableType.Null -> {
|
|
47
|
+
// NO-OP
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return jsonResult
|
|
53
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Scanbot Barcode Scanner SDK React Native Plugin
|
|
3
|
+
Copyright (c) 2024 Scanbot SDK GmbH. All rights reserved.
|
|
4
|
+
https://scanbot.io/sdk
|
|
5
|
+
*/
|
|
6
|
+
package io.scanbot.barcodesdk.plugin.reactnative.utils
|
|
7
|
+
|
|
8
|
+
import com.facebook.react.bridge.ReadableMap
|
|
9
|
+
import io.scanbot.barcodesdk.plugin.reactnative.extensions.toJSON
|
|
10
|
+
import io.scanbot.barcodesdk.plugin.reactnative.extensions.toWritableMap
|
|
11
|
+
import org.json.JSONObject
|
|
12
|
+
|
|
13
|
+
object JSONUtils {
|
|
14
|
+
|
|
15
|
+
@JvmStatic
|
|
16
|
+
fun jsonToWritableMap(jsonObject: JSONObject): ReadableMap {
|
|
17
|
+
return jsonObject.toWritableMap()
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@JvmStatic
|
|
21
|
+
fun readableMapToJson(readableMap: ReadableMap): JSONObject {
|
|
22
|
+
return readableMap.toJSON()
|
|
23
|
+
}
|
|
24
|
+
}
|
package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/ScanbotViewUtils.java
CHANGED
|
@@ -36,4 +36,8 @@ public class ScanbotViewUtils {
|
|
|
36
36
|
public static int convertDpToPx(Resources resources, int dp) {
|
|
37
37
|
return (int) Math.floor(dp * resources.getDisplayMetrics().density);
|
|
38
38
|
}
|
|
39
|
+
|
|
40
|
+
public static int convertDpToPx(Resources resources, float dp) {
|
|
41
|
+
return (int) Math.floor(dp * resources.getDisplayMetrics().density);
|
|
42
|
+
}
|
|
39
43
|
}
|
package/index.d.ts
CHANGED
|
@@ -1,42 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { ScanbotBarcodeCameraView } from "./src/components/barcode-camera-view/scanbot-barcode-camera-view";
|
|
6
|
-
import { ScanbotBarcodeCameraViewConfiguration} from "./src/components/barcode-camera-view/scanbot-barcode-camera-view-types";
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
BarcodeScannerConfiguration,
|
|
10
|
-
BatchBarcodeScannerConfiguration,
|
|
11
|
-
BarcodeDocumentFormat,
|
|
12
|
-
BarcodeFormat,
|
|
13
|
-
BarcodeResult,
|
|
14
|
-
BarcodeScannerResult,
|
|
15
|
-
BatchBarcodeScannerResult,
|
|
16
|
-
ScanbotBarcodeCameraView,
|
|
17
|
-
ScanbotBarcodeCameraViewConfiguration,
|
|
18
|
-
EngineMode,
|
|
19
|
-
GetLicenseInfoResult
|
|
20
|
-
}
|
|
1
|
+
import { BarcodeScannerConfiguration, BatchBarcodeScannerConfiguration, ScanbotBarcodeSdkConfiguration } from "./src/configurations";
|
|
2
|
+
import { DetectBarcodesOnImageArguments, ExtractImagesFromPdfArguments } from "./src/customConfigurations";
|
|
3
|
+
import { ResultWrapper } from "./src/customResults";
|
|
4
|
+
import { BarcodeScannerResult, BatchBarcodeScannerResult, GetLicenseInfoResult } from "./src/results";
|
|
21
5
|
|
|
22
6
|
export interface ScanbotBarcodeSdk {
|
|
23
7
|
// SDK Internal
|
|
24
|
-
initializeSdk(
|
|
25
|
-
getLicenseInfo(): Promise<GetLicenseInfoResult
|
|
8
|
+
initializeSdk(config: ScanbotBarcodeSdkConfiguration): Promise<ResultWrapper<string>>;
|
|
9
|
+
getLicenseInfo(): Promise<ResultWrapper<GetLicenseInfoResult>>;
|
|
26
10
|
|
|
27
|
-
cleanup(): Promise<
|
|
11
|
+
cleanup(): Promise<ResultWrapper<string>>;
|
|
28
12
|
|
|
29
13
|
// RTU-UI Barcode Scanning
|
|
30
|
-
startBarcodeScanner(
|
|
31
|
-
closeBarcodeScanner(): Promise<
|
|
14
|
+
startBarcodeScanner(config: BarcodeScannerConfiguration): Promise<ResultWrapper<BarcodeScannerResult>>;
|
|
15
|
+
closeBarcodeScanner(): Promise<ResultWrapper<undefined>>;
|
|
32
16
|
|
|
33
|
-
startBatchBarcodeScanner(
|
|
34
|
-
closeBatchBarcodeScanner(): Promise<
|
|
17
|
+
startBatchBarcodeScanner(config: BatchBarcodeScannerConfiguration): Promise<ResultWrapper<BatchBarcodeScannerResult>>;
|
|
18
|
+
closeBatchBarcodeScanner(): Promise<ResultWrapper<undefined>>;
|
|
35
19
|
|
|
36
20
|
// Other Barcode Scanning functionalities
|
|
37
21
|
detectBarcodesOnImage(
|
|
38
22
|
args: DetectBarcodesOnImageArguments
|
|
39
|
-
): Promise<
|
|
23
|
+
): Promise<ResultWrapper<BarcodeScannerResult>>;
|
|
24
|
+
|
|
25
|
+
extractImagesFromPDF(
|
|
26
|
+
args: ExtractImagesFromPdfArguments
|
|
27
|
+
): Promise<ResultWrapper<string[]>>;
|
|
40
28
|
}
|
|
41
29
|
|
|
42
30
|
declare var ScanbotBarcodeSDK: ScanbotBarcodeSdk;
|
|
@@ -44,4 +32,11 @@ declare var ScanbotBarcodeSDK: ScanbotBarcodeSdk;
|
|
|
44
32
|
export default ScanbotBarcodeSDK;
|
|
45
33
|
|
|
46
34
|
export * from './src/components/barcode-camera-view/scanbot-barcode-camera-view';
|
|
47
|
-
export * from './src/components/barcode-camera-view/scanbot-barcode-camera-view-types';
|
|
35
|
+
export * from './src/components/barcode-camera-view/scanbot-barcode-camera-view-types';
|
|
36
|
+
|
|
37
|
+
export * from './src/types'
|
|
38
|
+
export * from './src/customTypes'
|
|
39
|
+
export * from './src/results'
|
|
40
|
+
export * from './src/customResults'
|
|
41
|
+
export * from './src/configurations'
|
|
42
|
+
export * from './src/customConfigurations'
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
Scanbot Barcode Scanner SDK React Native Plugin
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2024 Scanbot SDK GmbH. All rights reserved.
|
|
4
4
|
https://scanbot.io/sdk
|
|
5
5
|
*/
|
|
6
6
|
import { NativeModules } from 'react-native';
|
|
@@ -10,4 +10,11 @@ const { ScanbotBarcodeSdk } = NativeModules;
|
|
|
10
10
|
export default ScanbotBarcodeSdk;
|
|
11
11
|
|
|
12
12
|
export * from './src/components/barcode-camera-view/scanbot-barcode-camera-view';
|
|
13
|
-
export * from './src/components/barcode-camera-view/scanbot-barcode-camera-view-types';
|
|
13
|
+
export * from './src/components/barcode-camera-view/scanbot-barcode-camera-view-types';
|
|
14
|
+
|
|
15
|
+
export * from './src/types'
|
|
16
|
+
export * from './src/customTypes'
|
|
17
|
+
export * from './src/results'
|
|
18
|
+
export * from './src/customResults'
|
|
19
|
+
export * from './src/configurations'
|
|
20
|
+
export * from './src/customConfigurations'
|
|
@@ -22,7 +22,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
22
22
|
@interface RTNScanbotBarcodeCameraView: RCTViewComponentView<SBSDKBarcodeScannerViewControllerDelegate>
|
|
23
23
|
|
|
24
24
|
@property SBSDKBarcodeScannerViewController* _Nullable cameraViewController;
|
|
25
|
-
@property NSMutableArray* _Nonnull barcodes;
|
|
26
25
|
|
|
27
26
|
// TODO: Check if required
|
|
28
27
|
@property (nonatomic, copy) RCTBubblingEventBlock _Nullable requestComponentReload;
|
|
@@ -14,11 +14,10 @@
|
|
|
14
14
|
#import <react/renderer/components/RTNScanbotBarcodeCameraViewSpecs/RCTComponentViewHelpers.h>
|
|
15
15
|
|
|
16
16
|
#import "RTNScanbotBarcodeCameraView.h"
|
|
17
|
-
#import "ObjectMapper.h"
|
|
18
|
-
#import "BarcodeMapping.h"
|
|
19
17
|
#import "RCTFabricComponentsPlugins.h"
|
|
20
18
|
|
|
21
19
|
#import <ScanbotBarcodeScannerSDK/ScanbotBarcodeScannerSDK.h>
|
|
20
|
+
#import <ScanbotBarcodeSDKWrapper/ScanbotBarcodeSDKWrapper-Swift.h>
|
|
22
21
|
#import <Foundation/Foundation.h>
|
|
23
22
|
|
|
24
23
|
using namespace facebook::react;
|
|
@@ -27,14 +26,18 @@ static inline NSString* toNSString(std::string value) {
|
|
|
27
26
|
return [[NSString alloc] initWithCString:value.c_str() encoding:NSUTF8StringEncoding];
|
|
28
27
|
}
|
|
29
28
|
|
|
30
|
-
static inline bool
|
|
31
|
-
|
|
29
|
+
static inline bool isFloatDefined(facebook::react::Float value) {
|
|
30
|
+
// If value is not set from the typescript, by default -1 is allocated from the props
|
|
31
|
+
return !(isnan(value) || value == -1);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
static inline bool isIntDefined(int value) {
|
|
35
|
+
// If value is not set from the typescript, by default -1 is allocated from the props
|
|
36
|
+
return !(isnan(value) || value == -1);
|
|
32
37
|
}
|
|
33
38
|
|
|
34
39
|
@interface RTNScanbotBarcodeCameraView () <RCTRTNScanbotBarcodeCameraViewViewProtocol>
|
|
35
40
|
@property(nonatomic, strong) SBSDKBarcodeScannerViewController *viewController;
|
|
36
|
-
@property(nonatomic, strong) SBSDKUIBarcodeFilter *barcodeFilter;
|
|
37
|
-
@property(nonatomic) CGFloat userDefinedCameraZoomFactor;
|
|
38
41
|
@property(nonatomic) BOOL isFirstLaunch;
|
|
39
42
|
@property(nonatomic) BOOL scanningEnabled;
|
|
40
43
|
@end
|
|
@@ -53,8 +56,6 @@ static inline bool isUndefined(facebook::react::Float value) {
|
|
|
53
56
|
static const auto defaultProps = std::make_shared<const RTNScanbotBarcodeCameraViewProps>();
|
|
54
57
|
_props = defaultProps;
|
|
55
58
|
|
|
56
|
-
self.barcodes = [[NSMutableArray alloc] init];
|
|
57
|
-
_userDefinedCameraZoomFactor = -1;
|
|
58
59
|
_scanningEnabled = true;
|
|
59
60
|
}
|
|
60
61
|
return self;
|
|
@@ -113,7 +114,7 @@ static inline bool isUndefined(facebook::react::Float value) {
|
|
|
113
114
|
return NULL;
|
|
114
115
|
}
|
|
115
116
|
|
|
116
|
-
- (void)sendScanResults:(NSArray<SBSDKBarcodeScannerResult*>*) results
|
|
117
|
+
- (void)sendScanResults:(NSArray<SBSDKBarcodeScannerResult*>*) results {
|
|
117
118
|
if (_eventEmitter == nullptr) {
|
|
118
119
|
return;
|
|
119
120
|
}
|
|
@@ -122,54 +123,42 @@ static inline bool isUndefined(facebook::react::Float value) {
|
|
|
122
123
|
return;
|
|
123
124
|
}
|
|
124
125
|
|
|
125
|
-
|
|
126
|
-
results = filterBarcodeResults(results, _barcodeFilter);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
NSDictionary* outResult = @{
|
|
130
|
-
@"result": @{
|
|
131
|
-
@"status": @"OK",
|
|
132
|
-
@"barcodes": jsonFromBarcodeResults(results)
|
|
133
|
-
}
|
|
134
|
-
};
|
|
126
|
+
NSDictionary* _Nullable result = [SBBWrapperBarcodeScannerResult nativeResultsToDictionary:results];
|
|
135
127
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
SBSDKBaseScannerViewFinderConfiguration* oldConfig = self.viewController.viewFinderConfiguration;
|
|
149
|
-
SBSDKBaseScannerViewFinderConfiguration* newConfig = [SBSDKBaseScannerViewFinderConfiguration defaultConfiguration];
|
|
150
|
-
|
|
151
|
-
newConfig.viewFinderEnabled = oldConfig.viewFinderEnabled;
|
|
152
|
-
newConfig.aspectRatio = oldConfig.aspectRatio;
|
|
153
|
-
newConfig.minimumInset = oldConfig.minimumInset;
|
|
154
|
-
newConfig.preferredHeight = oldConfig.preferredHeight;
|
|
155
|
-
newConfig.ignoresSafeAreaInsets = oldConfig.ignoresSafeAreaInsets;
|
|
156
|
-
newConfig.secondaryAspectRatio = oldConfig.secondaryAspectRatio;
|
|
157
|
-
newConfig.secondaryMinimumInset = oldConfig.secondaryMinimumInset;
|
|
158
|
-
newConfig.lineColor = oldConfig.lineColor;
|
|
159
|
-
newConfig.backgroundColor = oldConfig.backgroundColor;
|
|
160
|
-
newConfig.lineCornerRadius = oldConfig.lineCornerRadius;
|
|
161
|
-
newConfig.lineWidth = oldConfig.lineWidth;
|
|
162
|
-
newConfig.animateChanges = oldConfig.animateChanges;
|
|
163
|
-
newConfig.backgroundEffect = oldConfig.backgroundEffect;
|
|
164
|
-
|
|
165
|
-
return newConfig;
|
|
128
|
+
if(result != NULL) {
|
|
129
|
+
NSDictionary* outResult = @{
|
|
130
|
+
@"result": result
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
NSData *data = [NSJSONSerialization dataWithJSONObject:outResult options:NSJSONWritingFragmentsAllowed error:nil];
|
|
134
|
+
NSString *jsonResult = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
|
|
135
|
+
|
|
136
|
+
const auto &eventEmitter = std::dynamic_pointer_cast<const facebook::react::RTNScanbotBarcodeCameraViewEventEmitter>(_eventEmitter);
|
|
137
|
+
|
|
138
|
+
eventEmitter->onNativeBarcodeScannerResult(facebook::react::RTNScanbotBarcodeCameraViewEventEmitter::OnNativeBarcodeScannerResult{.jsonResult = std::string([jsonResult UTF8String])});
|
|
139
|
+
}
|
|
166
140
|
}
|
|
167
141
|
|
|
168
142
|
// MARK: - React Native Lifecycle
|
|
169
143
|
- (void)applyProps:(const facebook::react::Props::Shared &)props oldProps:(const facebook::react::Props::Shared &)oldProps forceUpdate:(bool)forceUpdate {
|
|
144
|
+
|
|
170
145
|
const auto &oldViewProps = *std::static_pointer_cast<RTNScanbotBarcodeCameraViewProps const>(_props);
|
|
171
146
|
const auto &newViewProps = *std::static_pointer_cast<RTNScanbotBarcodeCameraViewProps const>(props);
|
|
172
147
|
|
|
148
|
+
NSDictionary *oldViewPropsAsDictionary = [[NSDictionary alloc] init];
|
|
149
|
+
oldViewPropsAsDictionary = [self barcodeCameraViewConfigurationStructToDictionary:oldViewProps.configuration];
|
|
150
|
+
|
|
151
|
+
SBBWrapperBarcodeCameraViewConfiguration* oldBarcodeCameraViewConfiguration = [SBBWrapperBarcodeCameraViewConfiguration fromDicitonary:oldViewPropsAsDictionary];
|
|
152
|
+
|
|
153
|
+
NSDictionary *newViewPropsAsDictionary = [[NSDictionary alloc] init];
|
|
154
|
+
newViewPropsAsDictionary = [self barcodeCameraViewConfigurationStructToDictionary:newViewProps.configuration];
|
|
155
|
+
|
|
156
|
+
SBBWrapperBarcodeCameraViewConfiguration* newBarcodeCameraViewConfiguration = [SBBWrapperBarcodeCameraViewConfiguration fromDicitonary:newViewPropsAsDictionary];
|
|
157
|
+
|
|
158
|
+
if(newBarcodeCameraViewConfiguration == NULL || oldBarcodeCameraViewConfiguration == NULL) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
|
|
173
162
|
// -----------------------------------------
|
|
174
163
|
// START OF ViewFinderConfiguration MAPPING
|
|
175
164
|
// -----------------------------------------
|
|
@@ -180,124 +169,86 @@ static inline bool isUndefined(facebook::react::Float value) {
|
|
|
180
169
|
|
|
181
170
|
SBSDKBaseScannerViewFinderConfiguration* viewFinderConfiguration = [SBSDKBaseScannerViewFinderConfiguration defaultConfiguration];
|
|
182
171
|
|
|
183
|
-
viewFinderConfiguration.viewFinderEnabled =
|
|
184
|
-
|
|
185
|
-
if (!isUndefined(newViewProps.configuration.finderLineWidth)) {
|
|
186
|
-
viewFinderConfiguration.lineWidth = newViewProps.configuration.finderLineWidth;
|
|
187
|
-
|
|
188
|
-
}
|
|
172
|
+
viewFinderConfiguration.viewFinderEnabled = newBarcodeCameraViewConfiguration.shouldUseFinderView;
|
|
189
173
|
|
|
190
|
-
if (
|
|
191
|
-
viewFinderConfiguration.
|
|
174
|
+
if (isIntDefined(newBarcodeCameraViewConfiguration.finderLineWidth)) {
|
|
175
|
+
viewFinderConfiguration.lineWidth = newBarcodeCameraViewConfiguration.finderLineWidth;
|
|
192
176
|
}
|
|
193
|
-
|
|
194
|
-
if
|
|
195
|
-
viewFinderConfiguration.
|
|
177
|
+
|
|
178
|
+
if(![newBarcodeCameraViewConfiguration.finderLineColor isEqual: @""]) {
|
|
179
|
+
viewFinderConfiguration.lineColor = newBarcodeCameraViewConfiguration.finderLineColorAsUIColor;
|
|
196
180
|
}
|
|
197
|
-
|
|
198
|
-
if
|
|
199
|
-
|
|
200
|
-
viewFinderConfiguration.backgroundColor = [bgColor colorWithAlphaComponent:newViewProps.configuration.finderBackgroundOpacity];
|
|
181
|
+
|
|
182
|
+
if(![newBarcodeCameraViewConfiguration.finderBackgroundColor isEqual: @""] && isFloatDefined(newBarcodeCameraViewConfiguration.finderBackgroundOpacity)) {
|
|
183
|
+
viewFinderConfiguration.backgroundColor = [newBarcodeCameraViewConfiguration.finderBackgroundColorAsUIColor colorWithAlphaComponent:newBarcodeCameraViewConfiguration.finderBackgroundOpacity];
|
|
201
184
|
}
|
|
202
185
|
|
|
203
|
-
if (
|
|
204
|
-
|
|
205
|
-
!isUndefined(newViewProps.configuration.finderAspectRatio.height)
|
|
206
|
-
) {
|
|
207
|
-
viewFinderConfiguration.aspectRatio = [[SBSDKAspectRatio alloc] initWithWidth:newViewProps.configuration.finderAspectRatio.width
|
|
208
|
-
andHeight:newViewProps.configuration.finderAspectRatio.height];
|
|
186
|
+
if (isIntDefined(newBarcodeCameraViewConfiguration.finderAspectRatio.width) && isIntDefined(newBarcodeCameraViewConfiguration.finderAspectRatio.height)) {
|
|
187
|
+
viewFinderConfiguration.aspectRatio = [[SBSDKAspectRatio alloc] initWithWidth:newBarcodeCameraViewConfiguration.finderAspectRatio.width andHeight:newBarcodeCameraViewConfiguration.finderAspectRatio.height];
|
|
209
188
|
}
|
|
210
|
-
|
|
211
189
|
|
|
212
|
-
if (
|
|
213
|
-
|
|
214
|
-
!isUndefined(newViewProps.configuration.finderInset.right) &&
|
|
215
|
-
!isUndefined(newViewProps.configuration.finderInset.bottom)
|
|
216
|
-
) {
|
|
217
|
-
viewFinderConfiguration.minimumInset = UIEdgeInsetsMake(newViewProps.configuration.finderInset.top,
|
|
218
|
-
newViewProps.configuration.finderInset.left,
|
|
219
|
-
newViewProps.configuration.finderInset.bottom,
|
|
220
|
-
newViewProps.configuration.finderInset.right);
|
|
190
|
+
if (newBarcodeCameraViewConfiguration.finderInset.insetsAreSet) {
|
|
191
|
+
viewFinderConfiguration.minimumInset = newBarcodeCameraViewConfiguration.finderInset.insets;
|
|
221
192
|
}
|
|
222
193
|
|
|
223
194
|
self.viewController.viewFinderConfiguration = viewFinderConfiguration;
|
|
224
195
|
// ---------------------------------------
|
|
225
196
|
// END OF ViewFinderConfiguration MAPPING
|
|
226
197
|
// ---------------------------------------
|
|
227
|
-
|
|
228
|
-
if (forceUpdate || oldViewProps.configuration.lowPowerMode != newViewProps.configuration.lowPowerMode) {
|
|
229
|
-
// TODO: verify behavior
|
|
230
|
-
}
|
|
231
198
|
|
|
232
|
-
if (forceUpdate ||
|
|
233
|
-
|
|
234
|
-
self.viewController.additionalDetectionParameters.minimumTextLength = newViewProps.configuration.minimumTextLength;
|
|
235
|
-
}
|
|
199
|
+
if (isIntDefined(newBarcodeCameraViewConfiguration.minimumTextLength) && (forceUpdate || oldBarcodeCameraViewConfiguration.minimumTextLength != newBarcodeCameraViewConfiguration.minimumTextLength)) {
|
|
200
|
+
self.viewController.additionalDetectionParameters.minimumTextLength = newBarcodeCameraViewConfiguration.minimumTextLength;
|
|
236
201
|
}
|
|
237
202
|
|
|
238
|
-
if (forceUpdate ||
|
|
239
|
-
|
|
240
|
-
self.viewController.additionalDetectionParameters.maximumTextLength = newViewProps.configuration.maximumTextLength;
|
|
241
|
-
}
|
|
203
|
+
if (isIntDefined(newBarcodeCameraViewConfiguration.maximumTextLength) && (forceUpdate || oldBarcodeCameraViewConfiguration.maximumTextLength != newBarcodeCameraViewConfiguration.maximumTextLength)) {
|
|
204
|
+
self.viewController.additionalDetectionParameters.maximumTextLength = newBarcodeCameraViewConfiguration.maximumTextLength;
|
|
242
205
|
}
|
|
243
206
|
|
|
244
|
-
if (forceUpdate ||
|
|
245
|
-
|
|
246
|
-
self.viewController.additionalDetectionParameters.minimum1DBarcodesQuietZone = newViewProps.configuration.minimum1DBarcodesQuietZone;
|
|
247
|
-
}
|
|
207
|
+
if (isIntDefined(newBarcodeCameraViewConfiguration.minimum1DBarcodesQuietZone) && (forceUpdate || oldBarcodeCameraViewConfiguration.minimum1DBarcodesQuietZone != newBarcodeCameraViewConfiguration.minimum1DBarcodesQuietZone)) {
|
|
208
|
+
self.viewController.additionalDetectionParameters.minimum1DBarcodesQuietZone = newBarcodeCameraViewConfiguration.minimum1DBarcodesQuietZone;
|
|
248
209
|
}
|
|
249
210
|
|
|
250
|
-
if (forceUpdate ||
|
|
251
|
-
self.viewController.additionalDetectionParameters.stripCheckDigits =
|
|
211
|
+
if (forceUpdate || oldBarcodeCameraViewConfiguration.stripCheckDigits != newBarcodeCameraViewConfiguration.stripCheckDigits) {
|
|
212
|
+
self.viewController.additionalDetectionParameters.stripCheckDigits = newBarcodeCameraViewConfiguration.stripCheckDigits;
|
|
252
213
|
}
|
|
253
214
|
|
|
254
|
-
if (forceUpdate ||
|
|
255
|
-
self.viewController.additionalDetectionParameters.
|
|
215
|
+
if (forceUpdate || oldBarcodeCameraViewConfiguration.gs1Handling != newBarcodeCameraViewConfiguration.gs1Handling) {
|
|
216
|
+
self.viewController.additionalDetectionParameters.gs1Handling = newBarcodeCameraViewConfiguration.gs1Handling;
|
|
256
217
|
}
|
|
257
218
|
|
|
258
|
-
if (forceUpdate ||
|
|
259
|
-
self.viewController.additionalDetectionParameters.msiPlesseyChecksumAlgorithm =
|
|
219
|
+
if (forceUpdate || oldBarcodeCameraViewConfiguration.msiPlesseyChecksumAlgorithm != newBarcodeCameraViewConfiguration.msiPlesseyChecksumAlgorithm) {
|
|
220
|
+
self.viewController.additionalDetectionParameters.msiPlesseyChecksumAlgorithm = newBarcodeCameraViewConfiguration.msiPlesseyChecksumAlgorithm;
|
|
260
221
|
}
|
|
261
222
|
|
|
262
|
-
if (forceUpdate ||
|
|
263
|
-
self.viewController.additionalDetectionParameters.codeDensity =
|
|
223
|
+
if (forceUpdate || oldBarcodeCameraViewConfiguration.codeDensity != newBarcodeCameraViewConfiguration.codeDensity) {
|
|
224
|
+
self.viewController.additionalDetectionParameters.codeDensity = newBarcodeCameraViewConfiguration.codeDensity;
|
|
264
225
|
}
|
|
265
226
|
|
|
266
|
-
if (forceUpdate ||
|
|
267
|
-
self.viewController.flashLightEnabled =
|
|
227
|
+
if (forceUpdate || oldBarcodeCameraViewConfiguration.flashEnabled != newBarcodeCameraViewConfiguration.flashEnabled) {
|
|
228
|
+
self.viewController.flashLightEnabled = newBarcodeCameraViewConfiguration.flashEnabled;
|
|
268
229
|
}
|
|
269
230
|
|
|
270
|
-
if (forceUpdate ||
|
|
271
|
-
|
|
272
|
-
NSMutableArray* barcodeFormats = [NSMutableArray array];
|
|
273
|
-
for (auto const& format : newViewProps.configuration.barcodeFormats) {
|
|
274
|
-
SBSDKBarcodeType* type = barcodeTypeFromString(toNSString(format));
|
|
275
|
-
if (type != nil) {
|
|
276
|
-
[barcodeFormats addObject:type];
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
self.viewController.acceptedBarcodeTypes = [barcodeFormats copy];
|
|
280
|
-
}
|
|
231
|
+
if (forceUpdate || oldBarcodeCameraViewConfiguration.acceptedBarcodeTypes != newBarcodeCameraViewConfiguration.acceptedBarcodeTypes) {
|
|
232
|
+
self.viewController.acceptedBarcodeTypes = newBarcodeCameraViewConfiguration.acceptedBarcodeTypes;
|
|
281
233
|
}
|
|
282
|
-
|
|
283
|
-
if (forceUpdate ||
|
|
284
|
-
self.viewController.
|
|
234
|
+
|
|
235
|
+
if (forceUpdate || oldBarcodeCameraViewConfiguration.acceptedDocumentTypes != newBarcodeCameraViewConfiguration.acceptedDocumentTypes) {
|
|
236
|
+
self.viewController.acceptedDocumentTypes = newBarcodeCameraViewConfiguration.acceptedDocumentTypes;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
if (forceUpdate || oldBarcodeCameraViewConfiguration.engineMode != newBarcodeCameraViewConfiguration.engineMode) {
|
|
240
|
+
self.viewController.engineMode = newBarcodeCameraViewConfiguration.engineMode;
|
|
285
241
|
}
|
|
286
242
|
|
|
287
|
-
if (forceUpdate ||
|
|
288
|
-
|
|
289
|
-
if (newViewProps.configuration.cameraZoomFactor != _userDefinedCameraZoomFactor || _userDefinedCameraZoomFactor == -1) {
|
|
290
|
-
self.viewController.cameraZoomFactor = newViewProps.configuration.cameraZoomFactor;
|
|
291
|
-
_userDefinedCameraZoomFactor = newViewProps.configuration.cameraZoomFactor;
|
|
292
|
-
}
|
|
293
|
-
}
|
|
243
|
+
if (isFloatDefined(newBarcodeCameraViewConfiguration.cameraZoomFactor) && (forceUpdate || oldBarcodeCameraViewConfiguration.cameraZoomFactor != newBarcodeCameraViewConfiguration.cameraZoomFactor)) {
|
|
244
|
+
self.viewController.cameraZoomFactor = newBarcodeCameraViewConfiguration.cameraZoomFactor;
|
|
294
245
|
}
|
|
295
246
|
|
|
296
|
-
if (forceUpdate ||
|
|
297
|
-
|
|
247
|
+
if (forceUpdate || oldBarcodeCameraViewConfiguration.barcodesExtensionFilter != newBarcodeCameraViewConfiguration.barcodesExtensionFilter) {
|
|
248
|
+
self.viewController.extensionFilter = newBarcodeCameraViewConfiguration.barcodesExtensionFilter;
|
|
298
249
|
}
|
|
299
250
|
|
|
300
|
-
_scanningEnabled =
|
|
251
|
+
_scanningEnabled = newBarcodeCameraViewConfiguration.scanningEnabled;
|
|
301
252
|
}
|
|
302
253
|
|
|
303
254
|
- (void)updateProps:(const facebook::react::Props::Shared &)props oldProps:(const facebook::react::Props::Shared &)oldProps {
|
|
@@ -311,6 +262,43 @@ static inline bool isUndefined(facebook::react::Float value) {
|
|
|
311
262
|
[super updateProps:props oldProps:oldProps];
|
|
312
263
|
}
|
|
313
264
|
|
|
265
|
+
- barcodeCameraViewConfigurationStructToDictionary:(facebook::react::RTNScanbotBarcodeCameraViewConfigurationStruct) configurationStruct
|
|
266
|
+
{
|
|
267
|
+
return @{
|
|
268
|
+
@"flashEnabled": @(configurationStruct.flashEnabled),
|
|
269
|
+
@"barcodeFormats": [self vectorStringToNSArray:configurationStruct.barcodeFormats],
|
|
270
|
+
@"acceptedDocumentFormats": [self vectorStringToNSArray:configurationStruct.acceptedDocumentFormats],
|
|
271
|
+
@"engineMode": toNSString(configurationStruct.engineMode),
|
|
272
|
+
@"cameraZoomFactor": @(configurationStruct.cameraZoomFactor),
|
|
273
|
+
@"barcodesExtensionFilter": toNSString(configurationStruct.barcodesExtensionFilter),
|
|
274
|
+
@"scanningEnabled": @(configurationStruct.scanningEnabled),
|
|
275
|
+
@"minimumTextLength": @(configurationStruct.minimumTextLength),
|
|
276
|
+
@"maximumTextLength": @(configurationStruct.maximumTextLength),
|
|
277
|
+
@"minimum1DBarcodesQuietZone": @(configurationStruct.minimum1DBarcodesQuietZone),
|
|
278
|
+
@"stripCheckDigits": @(configurationStruct.stripCheckDigits),
|
|
279
|
+
@"gs1HandlingMode": toNSString(configurationStruct.gs1HandlingMode),
|
|
280
|
+
@"msiPlesseyChecksumAlgorithm": toNSString(configurationStruct.msiPlesseyChecksumAlgorithm),
|
|
281
|
+
@"codeDensity": toNSString(configurationStruct.codeDensity),
|
|
282
|
+
@"shouldUseFinderView": @(configurationStruct.shouldUseFinderView),
|
|
283
|
+
@"finderLineWidth": @(configurationStruct.finderLineWidth),
|
|
284
|
+
@"finderLineColor": toNSString(configurationStruct.finderLineColor),
|
|
285
|
+
@"finderBackgroundColor": toNSString(configurationStruct.finderBackgroundColor),
|
|
286
|
+
@"finderBackgroundOpacity": @(configurationStruct.finderBackgroundOpacity),
|
|
287
|
+
@"finderAspectRatio": @{@"width": @(configurationStruct.finderAspectRatio.width), @"height": @(configurationStruct.finderAspectRatio.height)},
|
|
288
|
+
@"finderInset": @{@"left": @(configurationStruct.finderInset.left), @"top": @(configurationStruct.finderInset.top), @"bottom": @(configurationStruct.finderInset.bottom), @"right": @(configurationStruct.finderInset.right)}
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
- (NSArray*)vectorStringToNSArray:(std::vector<std::string>) vector {
|
|
293
|
+
NSMutableArray* nsArray = [NSMutableArray array];
|
|
294
|
+
|
|
295
|
+
for (auto const& value : vector) {
|
|
296
|
+
[nsArray addObject: toNSString(value)];
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
return nsArray;
|
|
300
|
+
}
|
|
301
|
+
|
|
314
302
|
- (void)componentDidMount {
|
|
315
303
|
_isFirstLaunch = true;
|
|
316
304
|
[self applyProps:_props oldProps:_props forceUpdate:_isFirstLaunch];
|
|
@@ -328,7 +316,7 @@ static inline bool isUndefined(facebook::react::Float value) {
|
|
|
328
316
|
didDetectBarcodes:(NSArray<SBSDKBarcodeScannerResult *> *)codes
|
|
329
317
|
onImage:(nonnull UIImage *)image {
|
|
330
318
|
|
|
331
|
-
[self sendScanResults:codes
|
|
319
|
+
[self sendScanResults:codes];
|
|
332
320
|
}
|
|
333
321
|
|
|
334
322
|
- (BOOL)barcodeScannerControllerShouldDetectBarcodes:(SBSDKBarcodeScannerViewController *)controller {
|
|
@@ -336,23 +324,7 @@ static inline bool isUndefined(facebook::react::Float value) {
|
|
|
336
324
|
}
|
|
337
325
|
|
|
338
326
|
- (void)barcodeScannerController:(nonnull SBSDKBarcodeScannerViewController *)controller didDetectBarcodes:(nonnull NSArray<SBSDKBarcodeScannerResult *> *)codes {
|
|
339
|
-
[self sendScanResults:codes
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
- (NSArray*)hashedBarcodes {
|
|
344
|
-
NSMutableArray* outArray = [[NSMutableArray alloc] init];
|
|
345
|
-
for (NSDictionary* barcode in self.barcodes) {
|
|
346
|
-
NSString* hash = [RTNScanbotBarcodeCameraView hashFromBarcode:barcode];
|
|
347
|
-
[outArray addObject:hash];
|
|
348
|
-
}
|
|
349
|
-
return outArray;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
+ (NSString*)hashFromBarcode: (NSDictionary* _Nonnull)barcode {
|
|
353
|
-
NSString* text = [barcode objectForKey:@"barcode"];
|
|
354
|
-
NSString* type = [barcode objectForKey:@"type"];
|
|
355
|
-
return [[NSString stringWithFormat:@"%@_%@", text, type] lowercaseString];
|
|
327
|
+
[self sendScanResults:codes];
|
|
356
328
|
}
|
|
357
329
|
|
|
358
330
|
@end
|
|
@@ -18,12 +18,8 @@
|
|
|
18
18
|
@interface RNScanbotBarcodeCameraView: UIView<SBSDKBarcodeScannerViewControllerDelegate>
|
|
19
19
|
|
|
20
20
|
@property SBSDKBarcodeScannerViewController* _Nullable cameraViewController;
|
|
21
|
-
@property NSMutableArray* _Nonnull barcodes;
|
|
22
21
|
@property (nonatomic, copy) RCTBubblingEventBlock _Nullable onNativeBarcodeScannerResult;
|
|
23
22
|
@property (nonatomic, copy) RCTBubblingEventBlock _Nullable requestComponentReload;
|
|
24
|
-
@property (nonatomic) BOOL shouldUseFinderView;
|
|
25
|
-
@property (nonatomic, copy) NSDictionary* _Nullable configuration;
|
|
26
|
-
@property (nonatomic) BOOL finderInsetAvailable;
|
|
27
23
|
|
|
28
24
|
- (void) createCameraViewController;
|
|
29
25
|
- (UIViewController* _Nullable) getParentViewController;
|
|
@@ -35,33 +31,6 @@
|
|
|
35
31
|
|
|
36
32
|
@end
|
|
37
33
|
|
|
38
|
-
@interface RNScanbotCameraViewConfiguration: NSObject
|
|
39
|
-
|
|
40
|
-
// Non-Nullable Properties
|
|
41
|
-
@property (nonatomic) CGFloat finderLineWidth;
|
|
42
|
-
@property (nonatomic) UIColor* _Nonnull finderLineColor;
|
|
43
|
-
@property (nonatomic) UIColor* _Nonnull finderBackgroundColor;
|
|
44
|
-
@property (nonatomic) CGFloat finderBackgroundOpacity;
|
|
45
|
-
@property (nonatomic) SBSDKAspectRatio* _Nonnull finderAspectRatio;
|
|
46
|
-
@property (nonatomic) BOOL scanningEnabled;
|
|
47
|
-
|
|
48
|
-
// Nullable Properties (-1 for enums)
|
|
49
|
-
@property (nonatomic, copy) NSNumber* _Nullable shouldUseFinderView;
|
|
50
|
-
@property (nonatomic, copy) NSNumber* _Nullable flashEnabled;
|
|
51
|
-
@property (nonatomic, copy) NSNumber* _Nullable cameraZoomFactor;
|
|
52
|
-
@property (nonatomic, copy) NSNumber* _Nullable gs1DecodingEnabled;
|
|
53
|
-
@property (nonatomic, copy) NSNumber* _Nullable minimumTextLength;
|
|
54
|
-
@property (nonatomic, copy) NSNumber* _Nullable maximumTextLength;
|
|
55
|
-
@property (nonatomic, copy) NSNumber* _Nullable stripCheckDigits;
|
|
56
|
-
@property (nonatomic, copy) NSArray<SBSDKBarcodeType *>* _Nullable barcodeFormats;
|
|
57
|
-
@property (nonatomic, copy) NSArray<SBSDKBarcodeDocumentType *>* _Nullable acceptedDocumentFormats;
|
|
58
|
-
@property (nonatomic) SBSDKBarcodeMSIPlesseyChecksumAlgorithm msiPlesseyChecksumAlgorithm;
|
|
59
|
-
@property (nonatomic) SBSDKBarcodeEngineMode engineMode;
|
|
60
|
-
@property (nonatomic) SBSDKUIBarcodeFilter* _Nullable barcodeFilter;
|
|
61
|
-
@property (nonatomic) SBSDKBarcodeDensity codeDensity;
|
|
62
|
-
@property (nonatomic) UIEdgeInsets finderInset;
|
|
63
|
-
@end
|
|
64
|
-
|
|
65
34
|
#endif /* RNScanbotCameraView_h */
|
|
66
35
|
|
|
67
36
|
#endif // ifdef RCT_NEW_ARCH_ENABLED
|