react-native-scanbot-barcode-scanner-sdk 5.1.2-alpha.1 → 6.1.0-rc.1
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/Libraries.txt +439 -16
- package/RNScanbotBarcodeSDK.podspec +1 -1
- package/android/build.gradle +1 -1
- package/android/gradle.properties +4 -4
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule.kt +27 -25
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkPluginResultDelegate.kt +2 -2
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcode_scanner_view/ScanbotBarcodeScannerViewEvents.kt +4 -4
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcode_scanner_view/ScanbotBarcodeScannerViewManager.kt +0 -1
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/models/ScanbotBarcodeScannerModels.kt +4 -10
- package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerLegacyView.m +4 -4
- package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerView.mm +0 -4
- package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerViewControllerWrapper.h +0 -3
- package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerViewControllerWrapper.m +1 -5
- package/ios/ScanbotBarcodeSdk.m +57 -48
- package/ios/ScanbotBarcodeSdkPluginResultDelegate.h +1 -1
- package/ios/ScanbotBarcodeSdkPluginResultDelegate.m +13 -13
- package/lib/commonjs/component/spec/ScanbotBarcodeScannerViewNativeComponent.js.map +1 -1
- package/lib/commonjs/documents/BarcodeDocumentModel.js +612 -613
- package/lib/commonjs/documents/BarcodeDocumentModel.js.map +1 -1
- package/lib/commonjs/documents/GenericDocument.js +82 -49
- package/lib/commonjs/documents/GenericDocument.js.map +1 -1
- package/lib/commonjs/index.js +15 -13
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui_v2/barcode/ArTrackingOverlayConfiguration.js +10 -47
- package/lib/commonjs/ui_v2/barcode/ArTrackingOverlayConfiguration.js.map +1 -1
- package/lib/commonjs/ui_v2/barcode/BarcodeRecognizerConfiguration.js +47 -19
- package/lib/commonjs/ui_v2/barcode/BarcodeRecognizerConfiguration.js.map +1 -1
- package/lib/commonjs/ui_v2/barcode/BarcodeScannerConfiguration.js.map +1 -1
- package/lib/commonjs/ui_v2/barcode/FindAndPickScanningModeUseCase.js +8 -4
- package/lib/commonjs/ui_v2/barcode/FindAndPickScanningModeUseCase.js.map +1 -1
- package/lib/commonjs/ui_v2/barcode/MultipleScanningModeUseCase.js +9 -1
- package/lib/commonjs/ui_v2/barcode/MultipleScanningModeUseCase.js.map +1 -1
- package/lib/commonjs/ui_v2/barcode/SingleScanningModeUseCase.js +1 -1
- package/lib/commonjs/ui_v2/barcode/SingleScanningModeUseCase.js.map +1 -1
- package/lib/commonjs/ui_v2/common/CameraPermission.js +22 -6
- package/lib/commonjs/ui_v2/common/CameraPermission.js.map +1 -1
- package/lib/commonjs/ui_v2/common/Common.js +175 -5
- package/lib/commonjs/ui_v2/common/Common.js.map +1 -1
- package/lib/commonjs/ui_v2/common/NavigationBarConfiguration.js +6 -0
- package/lib/commonjs/ui_v2/common/NavigationBarConfiguration.js.map +1 -0
- package/lib/commonjs/ui_v2/common/ScanbotAlertDialog.js +27 -5
- package/lib/commonjs/ui_v2/common/ScanbotAlertDialog.js.map +1 -1
- package/lib/commonjs/ui_v2/common/UserGuidanceConfiguration.js +48 -1
- package/lib/commonjs/ui_v2/common/UserGuidanceConfiguration.js.map +1 -1
- package/lib/commonjs/ui_v2/index.js +14 -1
- package/lib/commonjs/ui_v2/index.js.map +1 -1
- package/lib/commonjs/utils.js +8 -1
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/module/component/spec/ScanbotBarcodeScannerViewNativeComponent.js.map +1 -1
- package/lib/module/documents/BarcodeDocumentModel.js +611 -612
- package/lib/module/documents/BarcodeDocumentModel.js.map +1 -1
- package/lib/module/documents/GenericDocument.js +84 -51
- package/lib/module/documents/GenericDocument.js.map +1 -1
- package/lib/module/index.js +7 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui_v2/barcode/ArTrackingOverlayConfiguration.js +1 -36
- package/lib/module/ui_v2/barcode/ArTrackingOverlayConfiguration.js.map +1 -1
- package/lib/module/ui_v2/barcode/BarcodeRecognizerConfiguration.js +47 -19
- package/lib/module/ui_v2/barcode/BarcodeRecognizerConfiguration.js.map +1 -1
- package/lib/module/ui_v2/barcode/BarcodeScannerConfiguration.js.map +1 -1
- package/lib/module/ui_v2/barcode/FindAndPickScanningModeUseCase.js +6 -2
- package/lib/module/ui_v2/barcode/FindAndPickScanningModeUseCase.js.map +1 -1
- package/lib/module/ui_v2/barcode/MultipleScanningModeUseCase.js +9 -1
- package/lib/module/ui_v2/barcode/MultipleScanningModeUseCase.js.map +1 -1
- package/lib/module/ui_v2/barcode/SingleScanningModeUseCase.js +1 -1
- package/lib/module/ui_v2/barcode/SingleScanningModeUseCase.js.map +1 -1
- package/lib/module/ui_v2/common/CameraPermission.js +22 -6
- package/lib/module/ui_v2/common/CameraPermission.js.map +1 -1
- package/lib/module/ui_v2/common/Common.js +168 -2
- package/lib/module/ui_v2/common/Common.js.map +1 -1
- package/lib/module/ui_v2/common/NavigationBarConfiguration.js +2 -0
- package/lib/module/ui_v2/common/NavigationBarConfiguration.js.map +1 -0
- package/lib/module/ui_v2/common/ScanbotAlertDialog.js +28 -5
- package/lib/module/ui_v2/common/ScanbotAlertDialog.js.map +1 -1
- package/lib/module/ui_v2/common/UserGuidanceConfiguration.js +47 -0
- package/lib/module/ui_v2/common/UserGuidanceConfiguration.js.map +1 -1
- package/lib/module/ui_v2/index.js +3 -1
- package/lib/module/ui_v2/index.js.map +1 -1
- package/lib/module/utils.js +6 -0
- package/lib/module/utils.js.map +1 -1
- package/lib/typescript/src/component/barcode-camera-view/ScanbotBarcodeCameraViewProperties.d.ts +3 -5
- package/lib/typescript/src/component/barcode-camera-view/ScanbotBarcodeCameraViewProperties.d.ts.map +1 -1
- package/lib/typescript/src/component/spec/ScanbotBarcodeScannerViewNativeComponent.d.ts +0 -1
- package/lib/typescript/src/component/spec/ScanbotBarcodeScannerViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/configurations.d.ts +13 -5
- package/lib/typescript/src/configurations.d.ts.map +1 -1
- package/lib/typescript/src/customConfigurations.d.ts +19 -3
- package/lib/typescript/src/customConfigurations.d.ts.map +1 -1
- package/lib/typescript/src/documents/BarcodeDocumentModel.d.ts +70 -71
- package/lib/typescript/src/documents/BarcodeDocumentModel.d.ts.map +1 -1
- package/lib/typescript/src/documents/CommonFieldType.d.ts +58 -109
- package/lib/typescript/src/documents/CommonFieldType.d.ts.map +1 -1
- package/lib/typescript/src/documents/GenericDocument.d.ts +95 -86
- package/lib/typescript/src/documents/GenericDocument.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +5 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/results.d.ts +1 -13
- package/lib/typescript/src/results.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +25 -20
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/ui_v2/barcode/ArTrackingOverlayConfiguration.d.ts +1 -22
- package/lib/typescript/src/ui_v2/barcode/ArTrackingOverlayConfiguration.d.ts.map +1 -1
- package/lib/typescript/src/ui_v2/barcode/BarcodeRecognizerConfiguration.d.ts +41 -19
- package/lib/typescript/src/ui_v2/barcode/BarcodeRecognizerConfiguration.d.ts.map +1 -1
- package/lib/typescript/src/ui_v2/barcode/BarcodeScannerConfiguration.d.ts.map +1 -1
- package/lib/typescript/src/ui_v2/barcode/FindAndPickScanningModeUseCase.d.ts +4 -0
- package/lib/typescript/src/ui_v2/barcode/FindAndPickScanningModeUseCase.d.ts.map +1 -1
- package/lib/typescript/src/ui_v2/barcode/MultipleScanningModeUseCase.d.ts +5 -0
- package/lib/typescript/src/ui_v2/barcode/MultipleScanningModeUseCase.d.ts.map +1 -1
- package/lib/typescript/src/ui_v2/common/CameraPermission.d.ts.map +1 -1
- package/lib/typescript/src/ui_v2/common/Common.d.ts +103 -1
- package/lib/typescript/src/ui_v2/common/Common.d.ts.map +1 -1
- package/lib/typescript/src/ui_v2/common/NavigationBarConfiguration.d.ts +12 -0
- package/lib/typescript/src/ui_v2/common/NavigationBarConfiguration.d.ts.map +1 -0
- package/lib/typescript/src/ui_v2/common/ScanbotAlertDialog.d.ts +4 -0
- package/lib/typescript/src/ui_v2/common/ScanbotAlertDialog.d.ts.map +1 -1
- package/lib/typescript/src/ui_v2/common/UserGuidanceConfiguration.d.ts +25 -0
- package/lib/typescript/src/ui_v2/common/UserGuidanceConfiguration.d.ts.map +1 -1
- package/lib/typescript/src/ui_v2/index.d.ts +1 -0
- package/lib/typescript/src/ui_v2/index.d.ts.map +1 -1
- package/lib/typescript/src/utils.d.ts +5 -0
- package/lib/typescript/src/utils.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/component/barcode-camera-view/ScanbotBarcodeCameraViewProperties.ts +2 -5
- package/src/component/spec/ScanbotBarcodeScannerViewNativeComponent.ts +0 -1
- package/src/configurations.ts +19 -7
- package/src/customConfigurations.ts +19 -3
- package/src/documents/BarcodeDocumentModel.ts +644 -623
- package/src/documents/CommonFieldType.ts +59 -82
- package/src/documents/GenericDocument.ts +104 -86
- package/src/index.ts +7 -1
- package/src/results.ts +1 -16
- package/src/types.ts +26 -23
- package/src/ui_v2/barcode/ArTrackingOverlayConfiguration.ts +1 -36
- package/src/ui_v2/barcode/BarcodeRecognizerConfiguration.ts +60 -22
- package/src/ui_v2/barcode/BarcodeScannerConfiguration.ts +2 -2
- package/src/ui_v2/barcode/BarcodeUseCase.ts +1 -1
- package/src/ui_v2/barcode/FindAndPickScanningModeUseCase.ts +6 -2
- package/src/ui_v2/barcode/MultipleScanningModeUseCase.ts +9 -1
- package/src/ui_v2/barcode/SingleScanningModeUseCase.ts +1 -1
- package/src/ui_v2/common/CameraPermission.ts +22 -6
- package/src/ui_v2/common/Common.ts +168 -2
- package/src/ui_v2/common/NavigationBarConfiguration.ts +13 -0
- package/src/ui_v2/common/ScanbotAlertDialog.ts +25 -6
- package/src/ui_v2/common/UserGuidanceConfiguration.ts +41 -0
- package/src/ui_v2/index.ts +5 -9
- package/src/utils.ts +10 -0
- package/lib/commonjs/documents/Point.js +0 -14
- package/lib/commonjs/documents/Point.js.map +0 -1
- package/lib/module/documents/Point.js +0 -7
- package/lib/module/documents/Point.js.map +0 -1
- package/lib/typescript/src/documents/Point.d.ts +0 -6
- package/lib/typescript/src/documents/Point.d.ts.map +0 -1
- package/src/documents/Point.ts +0 -10
package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule.kt
CHANGED
|
@@ -11,8 +11,12 @@ import com.facebook.react.bridge.ReadableMap
|
|
|
11
11
|
import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
12
12
|
import io.scanbot.barcodesdk.plugin.reactnative.extensions.toJSON
|
|
13
13
|
import io.scanbot.barcodesdk.plugin.reactnative.extensions.toWritableMap
|
|
14
|
-
import io.scanbot.sdk_wrapper.barcode.
|
|
15
|
-
import io.scanbot.sdk_wrapper.barcode.
|
|
14
|
+
import io.scanbot.sdk_wrapper.barcode.operations.detection.SBBDetectBarcodes
|
|
15
|
+
import io.scanbot.sdk_wrapper.barcode.operations.image_operations.SBBImageOperations
|
|
16
|
+
import io.scanbot.sdk_wrapper.barcode.operations.license.SBBLicenseOperations
|
|
17
|
+
import io.scanbot.sdk_wrapper.barcode.operations.pdf_extraction.SBBExtractFromPdf
|
|
18
|
+
import io.scanbot.sdk_wrapper.barcode.operations.setup.SBBSetupOperations
|
|
19
|
+
import io.scanbot.sdk_wrapper.barcode.rtuui.SBBRtuUi
|
|
16
20
|
import org.json.JSONException
|
|
17
21
|
import org.json.JSONObject
|
|
18
22
|
|
|
@@ -34,7 +38,7 @@ class ScanbotBarcodeSdkModule(private val reactContext: ReactApplicationContext)
|
|
|
34
38
|
configuration, promise
|
|
35
39
|
) { configurationAsJSON, currentActivity ->
|
|
36
40
|
|
|
37
|
-
|
|
41
|
+
SBBSetupOperations.initializeSdk(
|
|
38
42
|
currentActivity.application,
|
|
39
43
|
configurationAsJSON,
|
|
40
44
|
ScanbotBarcodeSdkPluginResultDelegate(promise)
|
|
@@ -45,16 +49,12 @@ class ScanbotBarcodeSdkModule(private val reactContext: ReactApplicationContext)
|
|
|
45
49
|
|
|
46
50
|
@ReactMethod
|
|
47
51
|
fun getLicenseInfo(promise: Promise) {
|
|
48
|
-
|
|
49
|
-
ScanbotBarcodeSdkPluginResultDelegate(promise)
|
|
50
|
-
)
|
|
52
|
+
SBBLicenseOperations.getLicenseInfo(ScanbotBarcodeSdkPluginResultDelegate(promise))
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
@ReactMethod
|
|
54
56
|
fun cleanup(promise: Promise) {
|
|
55
|
-
|
|
56
|
-
ScanbotBarcodeSdkPluginResultDelegate(promise)
|
|
57
|
-
)
|
|
57
|
+
SBBSetupOperations.cleanup(ScanbotBarcodeSdkPluginResultDelegate(promise))
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
@ReactMethod
|
|
@@ -63,7 +63,7 @@ class ScanbotBarcodeSdkModule(private val reactContext: ReactApplicationContext)
|
|
|
63
63
|
) = runOperationWithJSONParamAndSafeActivity(
|
|
64
64
|
configuration, promise
|
|
65
65
|
) { configurationAsJSON, currentActivity ->
|
|
66
|
-
|
|
66
|
+
SBBRtuUi.startLegacyBarcodeScanner(
|
|
67
67
|
currentActivity, configurationAsJSON, ScanbotBarcodeSdkPluginResultDelegate(promise)
|
|
68
68
|
)
|
|
69
69
|
}
|
|
@@ -71,7 +71,7 @@ class ScanbotBarcodeSdkModule(private val reactContext: ReactApplicationContext)
|
|
|
71
71
|
@ReactMethod
|
|
72
72
|
fun closeBarcodeScanner(promise: Promise) =
|
|
73
73
|
runOperationWithSafeActivity(promise) { currentActivity ->
|
|
74
|
-
|
|
74
|
+
SBBRtuUi.closeLegacyBarcodeScanner(
|
|
75
75
|
currentActivity, ScanbotBarcodeSdkPluginResultDelegate(promise)
|
|
76
76
|
)
|
|
77
77
|
}
|
|
@@ -82,7 +82,7 @@ class ScanbotBarcodeSdkModule(private val reactContext: ReactApplicationContext)
|
|
|
82
82
|
) = runOperationWithJSONParamAndSafeActivity(
|
|
83
83
|
configuration, promise
|
|
84
84
|
) { configurationAsJSON, currentActivity ->
|
|
85
|
-
|
|
85
|
+
SBBRtuUi.startLegacyBatchBarcodeScanner(
|
|
86
86
|
currentActivity, configurationAsJSON, ScanbotBarcodeSdkPluginResultDelegate(promise)
|
|
87
87
|
)
|
|
88
88
|
}
|
|
@@ -90,7 +90,7 @@ class ScanbotBarcodeSdkModule(private val reactContext: ReactApplicationContext)
|
|
|
90
90
|
@ReactMethod
|
|
91
91
|
fun closeBatchBarcodeScanner(promise: Promise) =
|
|
92
92
|
runOperationWithSafeActivity(promise) { currentActivity ->
|
|
93
|
-
|
|
93
|
+
SBBRtuUi.closeLegacyBatchBarcodeScanner(
|
|
94
94
|
currentActivity, ScanbotBarcodeSdkPluginResultDelegate(promise)
|
|
95
95
|
)
|
|
96
96
|
}
|
|
@@ -102,14 +102,14 @@ class ScanbotBarcodeSdkModule(private val reactContext: ReactApplicationContext)
|
|
|
102
102
|
configuration, promise
|
|
103
103
|
) { configurationAsJSON, currentActivity ->
|
|
104
104
|
if (barcodeItemMapperImplemented) {
|
|
105
|
-
|
|
105
|
+
SBBRtuUi.startBarcodeScanner(
|
|
106
106
|
currentActivity, configurationAsJSON, ScanbotBarcodeSdkPluginResultDelegate(promise)
|
|
107
107
|
) {
|
|
108
108
|
reactContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
|
|
109
109
|
.emit(BARCODE_ITEM_MAPPER_EVENT, it.toWritableMap())
|
|
110
110
|
}
|
|
111
111
|
} else {
|
|
112
|
-
|
|
112
|
+
SBBRtuUi.startBarcodeScanner(
|
|
113
113
|
currentActivity, configurationAsJSON, ScanbotBarcodeSdkPluginResultDelegate(promise)
|
|
114
114
|
)
|
|
115
115
|
}
|
|
@@ -121,17 +121,14 @@ class ScanbotBarcodeSdkModule(private val reactContext: ReactApplicationContext)
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
@ReactMethod
|
|
124
|
-
fun onBarcodeItemMapper(
|
|
125
|
-
|
|
126
|
-
barcodeItem.toJSON(),
|
|
127
|
-
barcodeMappedData?.toJSON()
|
|
128
|
-
)
|
|
124
|
+
fun onBarcodeItemMapper(barcodeItemUuid: String, barcodeMappedData: ReadableMap?) {
|
|
125
|
+
SBBRtuUi.onBarcodeItemMapper(barcodeItemUuid, barcodeMappedData?.toJSON())
|
|
129
126
|
}
|
|
130
127
|
|
|
131
128
|
@ReactMethod
|
|
132
129
|
fun detectBarcodesOnImage(configuration: ReadableMap, promise: Promise) =
|
|
133
130
|
runOperationWithJSONParam(configuration, promise) { configurationAsJSON ->
|
|
134
|
-
|
|
131
|
+
SBBDetectBarcodes.detectOnImage(
|
|
135
132
|
configurationAsJSON, ScanbotBarcodeSdkPluginResultDelegate(promise)
|
|
136
133
|
)
|
|
137
134
|
}
|
|
@@ -139,17 +136,22 @@ class ScanbotBarcodeSdkModule(private val reactContext: ReactApplicationContext)
|
|
|
139
136
|
@ReactMethod
|
|
140
137
|
fun extractImagesFromPDF(configuration: ReadableMap, promise: Promise) =
|
|
141
138
|
runOperationWithJSONParam(configuration, promise) { configurationAsJSON ->
|
|
142
|
-
|
|
139
|
+
SBBExtractFromPdf.extractImages(
|
|
143
140
|
configurationAsJSON, ScanbotBarcodeSdkPluginResultDelegate(promise)
|
|
144
141
|
)
|
|
145
142
|
}
|
|
146
143
|
|
|
144
|
+
@ReactMethod
|
|
145
|
+
fun getImageData(imageFileUri: String, promise: Promise) {
|
|
146
|
+
SBBImageOperations.getImageData(
|
|
147
|
+
imageFileUri, ScanbotBarcodeSdkPluginResultDelegate(promise)
|
|
148
|
+
)
|
|
149
|
+
}
|
|
150
|
+
|
|
147
151
|
override fun onActivityResult(
|
|
148
152
|
activity: Activity, requestCode: Int, resultCode: Int, intent: Intent?
|
|
149
153
|
) {
|
|
150
|
-
|
|
151
|
-
requestCode, resultCode, intent
|
|
152
|
-
)
|
|
154
|
+
SBBRtuUi.onActivityResult(requestCode, resultCode, intent)
|
|
153
155
|
}
|
|
154
156
|
|
|
155
157
|
override fun onNewIntent(intent: Intent?) {
|
|
@@ -2,12 +2,12 @@ package io.scanbot.barcodesdk.plugin.reactnative
|
|
|
2
2
|
|
|
3
3
|
import com.facebook.react.bridge.Promise
|
|
4
4
|
import io.scanbot.barcodesdk.plugin.reactnative.extensions.toWritableMap
|
|
5
|
-
import io.scanbot.sdk_wrapper.interfaces.
|
|
5
|
+
import io.scanbot.sdk_wrapper.interfaces.SBResultDelegate
|
|
6
6
|
import org.json.JSONObject
|
|
7
7
|
|
|
8
8
|
class ScanbotBarcodeSdkPluginResultDelegate(
|
|
9
9
|
private val promise: Promise?
|
|
10
|
-
) :
|
|
10
|
+
) : SBResultDelegate {
|
|
11
11
|
|
|
12
12
|
override fun didResolvePromise(resultAsJSON: JSONObject) {
|
|
13
13
|
try {
|
|
@@ -7,8 +7,8 @@ import io.scanbot.barcodesdk.plugin.reactnative.extensions.toWritableMap
|
|
|
7
7
|
import io.scanbot.sdk.barcode.entity.BarcodeItem
|
|
8
8
|
import io.scanbot.sdk.barcode.entity.BarcodeScanningResult
|
|
9
9
|
import io.scanbot.sdk_wrapper.SBWrapper
|
|
10
|
-
import io.scanbot.sdk_wrapper.barcode.results.
|
|
11
|
-
import io.scanbot.sdk_wrapper.barcode.results.
|
|
10
|
+
import io.scanbot.sdk_wrapper.barcode.results.SBLegacyBarcodeResultField
|
|
11
|
+
import io.scanbot.sdk_wrapper.barcode.results.SBLegacyBarcodeScannerResult
|
|
12
12
|
import org.json.JSONObject
|
|
13
13
|
|
|
14
14
|
interface BaseEvent {
|
|
@@ -45,7 +45,7 @@ class BarcodeScannerResultEvent(private val barcodeResult: BarcodeScanningResult
|
|
|
45
45
|
putMap(
|
|
46
46
|
"result", JSONObject(
|
|
47
47
|
SBWrapper.gson.toJson(
|
|
48
|
-
|
|
48
|
+
SBLegacyBarcodeScannerResult.fromNativeBarcodeResult(barcodeResult)
|
|
49
49
|
)
|
|
50
50
|
).toWritableMap()
|
|
51
51
|
)
|
|
@@ -66,7 +66,7 @@ class BarcodeSelectionResultEvent(private val barcodeItem: BarcodeItem) : BaseEv
|
|
|
66
66
|
putMap(
|
|
67
67
|
"result", JSONObject(
|
|
68
68
|
SBWrapper.gson.toJson(
|
|
69
|
-
|
|
69
|
+
SBLegacyBarcodeResultField.fromNativeBarcodeResult(barcodeItem)
|
|
70
70
|
)
|
|
71
71
|
).toWritableMap()
|
|
72
72
|
)
|
|
@@ -168,7 +168,6 @@ class ScanbotBarcodeScannerViewManager : SimpleViewManager<ScanbotBarcodeScanner
|
|
|
168
168
|
this.setEngineMode(config.engineMode!!)
|
|
169
169
|
this.modifyAdditionalConfig {
|
|
170
170
|
this.setLowPowerMode(config.lowPowerMode!!)
|
|
171
|
-
this.setCodeDensity(config.codeDensity!!)
|
|
172
171
|
this.setGs1HandlingMode(config.gs1HandlingMode!!)
|
|
173
172
|
this.setMinimumTextLength(config.minimumTextLength!!)
|
|
174
173
|
this.setMaximumTextLength(config.maximumTextLength!!)
|
|
@@ -3,7 +3,6 @@ package io.scanbot.barcodesdk.plugin.reactnative.models
|
|
|
3
3
|
import android.graphics.Color
|
|
4
4
|
import androidx.annotation.Keep
|
|
5
5
|
import io.scanbot.sdk.AspectRatio
|
|
6
|
-
import io.scanbot.sdk.barcode.entity.BarcodeDensity
|
|
7
6
|
import io.scanbot.sdk.barcode.entity.BarcodeDocumentFormat
|
|
8
7
|
import io.scanbot.sdk.barcode.entity.BarcodeFormat
|
|
9
8
|
import io.scanbot.sdk.barcode.entity.EngineMode
|
|
@@ -18,7 +17,7 @@ import io.scanbot.sdk.ui.configuration.json.JsonBarcodesExtensionFilter
|
|
|
18
17
|
data class DetectorConfig(
|
|
19
18
|
val barcodeFormats: List<BarcodeFormat>? = listOf(),
|
|
20
19
|
val acceptedDocumentFormats: List<BarcodeDocumentFormat>? = listOf(),
|
|
21
|
-
val engineMode: EngineMode? =
|
|
20
|
+
val engineMode: EngineMode? = EngineMode.NextGen,
|
|
22
21
|
val barcodesExtensionFilter: JsonBarcodesExtensionFilter? = JsonBarcodesExtensionFilter.NO_FILTER,
|
|
23
22
|
// Additional Config
|
|
24
23
|
val lowPowerMode: Boolean? = false,
|
|
@@ -27,8 +26,7 @@ data class DetectorConfig(
|
|
|
27
26
|
val minimum1DBarcodesQuietZone: Int? = 0,
|
|
28
27
|
val stripCheckDigits: Boolean? = false,
|
|
29
28
|
val gs1HandlingMode: Gs1Handling? = Gs1Handling.PARSE,
|
|
30
|
-
val msiPlesseyChecksumAlgorithm: MSIPlesseyChecksumAlgorithm? = MSIPlesseyChecksumAlgorithm.Mod10
|
|
31
|
-
val codeDensity: BarcodeDensity? = BarcodeDensity.LOW
|
|
29
|
+
val msiPlesseyChecksumAlgorithm: MSIPlesseyChecksumAlgorithm? = MSIPlesseyChecksumAlgorithm.Mod10
|
|
32
30
|
)
|
|
33
31
|
|
|
34
32
|
class PolygonStyleConfig(
|
|
@@ -150,8 +148,7 @@ object CameraConfiguration {
|
|
|
150
148
|
|
|
151
149
|
@Keep
|
|
152
150
|
data class SelectedBarcodes(
|
|
153
|
-
val textWithExtension: String,
|
|
154
|
-
val type: BarcodeFormat
|
|
151
|
+
val textWithExtension: String, val type: BarcodeFormat
|
|
155
152
|
)
|
|
156
153
|
|
|
157
154
|
@Keep
|
|
@@ -162,9 +159,6 @@ data class ZoomRangeConfig(
|
|
|
162
159
|
|
|
163
160
|
@Keep
|
|
164
161
|
data class FinderInsets(
|
|
165
|
-
var left: Int,
|
|
166
|
-
var right: Int,
|
|
167
|
-
var top: Int,
|
|
168
|
-
var bottom: Int
|
|
162
|
+
var left: Int, var right: Int, var top: Int, var bottom: Int
|
|
169
163
|
)
|
|
170
164
|
|
|
@@ -163,8 +163,6 @@
|
|
|
163
163
|
|
|
164
164
|
[RNScanbotBarcodeScannerViewControllerWrapper setMsiPlesseyChecksumAlgorithm:additionalConfig msiPlesseyChecksumAlgorithm:decodedConfig.msiPlesseyChecksumAlgorithm];
|
|
165
165
|
|
|
166
|
-
[RNScanbotBarcodeScannerViewControllerWrapper setCodeDensity:additionalConfig codeDencity:decodedConfig.codeDensity];
|
|
167
|
-
|
|
168
166
|
self.scannerViewController.additionalDetectionParameters = additionalConfig;
|
|
169
167
|
}
|
|
170
168
|
|
|
@@ -205,9 +203,11 @@
|
|
|
205
203
|
}
|
|
206
204
|
|
|
207
205
|
- (void) setOverlayTextFormat:(NSString * _Nullable) value {
|
|
208
|
-
|
|
206
|
+
SBBWrapperBarcodeCameraViewConfiguration* decodedConfig = [SBBWrapperBarcodeCameraViewConfiguration fromDicitonary: @{
|
|
207
|
+
@"textFormat": value
|
|
208
|
+
}];
|
|
209
209
|
|
|
210
|
-
[RNScanbotBarcodeScannerViewControllerWrapper setOverlayTextFormat:self.scannerViewController value:
|
|
210
|
+
[RNScanbotBarcodeScannerViewControllerWrapper setOverlayTextFormat:self.scannerViewController value: decodedConfig.textFormat];
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
- (void) freezeCamera {
|
|
@@ -85,7 +85,6 @@ using namespace facebook::react;
|
|
|
85
85
|
@"barcodesExtensionFilter": toNSString(newViewProps.detectorConfig.barcodesExtensionFilter),
|
|
86
86
|
@"gs1HandlingMode": toNSString(newViewProps.detectorConfig.gs1HandlingMode),
|
|
87
87
|
@"msiPlesseyChecksumAlgorithm": toNSString(newViewProps.detectorConfig.msiPlesseyChecksumAlgorithm),
|
|
88
|
-
@"codeDensity": toNSString(newViewProps.detectorConfig.codeDensity),
|
|
89
88
|
@"textFormat": toNSString(newViewProps.overlayTextFormat)
|
|
90
89
|
}];
|
|
91
90
|
|
|
@@ -178,9 +177,6 @@ using namespace facebook::react;
|
|
|
178
177
|
[RNScanbotBarcodeScannerViewControllerWrapper setMsiPlesseyChecksumAlgorithm:additionalConfig
|
|
179
178
|
msiPlesseyChecksumAlgorithm:decodedConfig.msiPlesseyChecksumAlgorithm];
|
|
180
179
|
}
|
|
181
|
-
if(![self compareStringProps:oldViewProps.detectorConfig.codeDensity withString:newViewProps.detectorConfig.codeDensity]){
|
|
182
|
-
[RNScanbotBarcodeScannerViewControllerWrapper setCodeDensity:additionalConfig codeDencity:decodedConfig.codeDensity];
|
|
183
|
-
}
|
|
184
180
|
// MARK: -
|
|
185
181
|
// MARK: Tracking Overlay Config
|
|
186
182
|
if(oldViewProps.overlayEnabled != newViewProps.overlayEnabled){
|
|
@@ -66,9 +66,6 @@
|
|
|
66
66
|
+ (void) setMsiPlesseyChecksumAlgorithm:(SBSDKBarcodeAdditionalParameters* _Nonnull)config
|
|
67
67
|
msiPlesseyChecksumAlgorithm:(SBSDKBarcodeMSIPlesseyChecksumAlgorithm)msiPlesseyChecksumAlgorithm;
|
|
68
68
|
|
|
69
|
-
+ (void) setCodeDensity:(SBSDKBarcodeAdditionalParameters* _Nonnull)config
|
|
70
|
-
codeDencity:(SBSDKBarcodeDensity)codeDencity;
|
|
71
|
-
|
|
72
69
|
+ (void) setLowPowerMode:(SBSDKBarcodeScannerViewController* _Nonnull)controller
|
|
73
70
|
value:(BOOL)value;
|
|
74
71
|
|
|
@@ -137,10 +137,6 @@
|
|
|
137
137
|
config.msiPlesseyChecksumAlgorithm = msiPlesseyChecksumAlgorithm;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
+ (void)setCodeDensity:(SBSDKBarcodeAdditionalParameters * _Nonnull)config codeDencity:(SBSDKBarcodeDensity)codeDencity {
|
|
141
|
-
config.codeDensity = codeDencity;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
140
|
+ (void)freezeCamera:(SBSDKBarcodeScannerViewController * _Nonnull)controller {
|
|
145
141
|
[controller freezeCamera];
|
|
146
142
|
}
|
|
@@ -152,7 +148,7 @@
|
|
|
152
148
|
+ (NSString *) jsonFromResultOrNil:(NSArray<SBSDKBarcodeScannerResult *> * _Nonnull)codes {
|
|
153
149
|
if(!codes || codes.count == 0) return nil;
|
|
154
150
|
|
|
155
|
-
NSDictionary* _Nullable result = [
|
|
151
|
+
NSDictionary* _Nullable result = [SBBarcodeScannerUtils nativeResultsToDictionary:codes];
|
|
156
152
|
if(result != NULL) {
|
|
157
153
|
NSData *data = [NSJSONSerialization dataWithJSONObject:result options:NSJSONWritingFragmentsAllowed error:nil];
|
|
158
154
|
return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
|
package/ios/ScanbotBarcodeSdk.m
CHANGED
|
@@ -10,25 +10,23 @@ RCT_EXPORT_MODULE()
|
|
|
10
10
|
|
|
11
11
|
NSString *const BarcodeItemMapperEvent = @"barcodeItemMapperEvent";
|
|
12
12
|
|
|
13
|
+
|
|
13
14
|
RCT_EXPORT_METHOD(initializeSdk:(NSDictionary *)configuration
|
|
14
15
|
withResolver:(RCTPromiseResolveBlock)resolve
|
|
15
16
|
withRejecter:(RCTPromiseRejectBlock)reject) {
|
|
16
|
-
|
|
17
|
-
[SBBWrapperOperations initializeSDKWithConfigurationAsDictionary:configuration resultDelegate: [self createResultDelegate:resolve reject:reject]];
|
|
17
|
+
[SBBWrapper initializeSDKWithConfiguration:configuration resultDelegate: [self createResultDelegate:resolve reject:reject]];
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
RCT_EXPORT_METHOD(getLicenseInfo:
|
|
21
21
|
(RCTPromiseResolveBlock)resolve
|
|
22
22
|
withRejecter:(RCTPromiseRejectBlock)reject) {
|
|
23
|
-
|
|
24
|
-
[SBWrapperOperations getLicenseInfo: [self createResultDelegate:resolve reject:reject]];
|
|
23
|
+
[SBBWrapper getLicenseInfoWithResultDelegate: [self createResultDelegate:resolve reject:reject]];
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
RCT_EXPORT_METHOD(cleanup:
|
|
28
27
|
(RCTPromiseResolveBlock)resolve
|
|
29
28
|
withRejecter:(RCTPromiseRejectBlock)reject) {
|
|
30
|
-
|
|
31
|
-
[SBBWrapperOperations cleanupWithResultDelegate: [self createResultDelegate:resolve reject:reject]];
|
|
29
|
+
[SBBWrapper cleanupWithResultDelegate: [self createResultDelegate:resolve reject:reject]];
|
|
32
30
|
}
|
|
33
31
|
|
|
34
32
|
|
|
@@ -37,21 +35,21 @@ RCT_EXPORT_METHOD(startBarcodeScanner:(NSDictionary*)configuration
|
|
|
37
35
|
withRejecter:(RCTPromiseRejectBlock)reject) {
|
|
38
36
|
|
|
39
37
|
runOnMainThread(^{
|
|
40
|
-
UIViewController *presentedViewController =
|
|
41
|
-
|
|
38
|
+
UIViewController *presentedViewController = [self parentViewController:reject];
|
|
42
39
|
if (presentedViewController == NULL) {
|
|
43
|
-
|
|
44
|
-
} else {
|
|
45
|
-
[SBBWrapperOperations startBarcodeScannerWithParentViewController:presentedViewController configurationAsDictionary:configuration resultDelegate:[self createResultDelegate:resolve reject:reject]];
|
|
40
|
+
return;
|
|
46
41
|
}
|
|
42
|
+
|
|
43
|
+
[SBBRTUUI startBarcodeScannerWithParentViewController:presentedViewController configuration:configuration resultDelegate:[self createResultDelegate:resolve reject:reject]];
|
|
47
44
|
});
|
|
48
45
|
}
|
|
49
46
|
|
|
50
47
|
RCT_EXPORT_METHOD(closeBarcodeScanner:
|
|
51
48
|
(RCTPromiseResolveBlock)resolve
|
|
52
49
|
withRejecter:(RCTPromiseRejectBlock)reject) {
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
runOnMainThread(^{
|
|
51
|
+
[SBBRTUUI closeBarcodeScannerWithResultDelegate: [self createResultDelegate:resolve reject:reject]];
|
|
52
|
+
});
|
|
55
53
|
}
|
|
56
54
|
|
|
57
55
|
RCT_EXPORT_METHOD(startBatchBarcodeScanner:(NSDictionary*)configuration
|
|
@@ -59,21 +57,21 @@ RCT_EXPORT_METHOD(startBatchBarcodeScanner:(NSDictionary*)configuration
|
|
|
59
57
|
withRejecter:(RCTPromiseRejectBlock)reject) {
|
|
60
58
|
|
|
61
59
|
runOnMainThread(^{
|
|
62
|
-
UIViewController *presentedViewController =
|
|
63
|
-
|
|
60
|
+
UIViewController *presentedViewController = [self parentViewController:reject];
|
|
64
61
|
if (presentedViewController == NULL) {
|
|
65
|
-
|
|
66
|
-
} else {
|
|
67
|
-
[SBBWrapperOperations startBatchBarcodeScannerWithParentViewController:presentedViewController configurationAsDictionary:configuration resultDelegate:[self createResultDelegate:resolve reject:reject]];
|
|
62
|
+
return;
|
|
68
63
|
}
|
|
64
|
+
|
|
65
|
+
[SBBRTUUI startBatchBarcodeScannerWithParentViewController:presentedViewController configuration:configuration resultDelegate:[self createResultDelegate:resolve reject:reject]];
|
|
69
66
|
});
|
|
70
67
|
}
|
|
71
68
|
|
|
72
69
|
RCT_EXPORT_METHOD(closeBatchBarcodeScanner:
|
|
73
70
|
(RCTPromiseResolveBlock)resolve
|
|
74
71
|
withRejecter:(RCTPromiseRejectBlock)reject) {
|
|
75
|
-
|
|
76
|
-
|
|
72
|
+
runOnMainThread(^{
|
|
73
|
+
[SBBRTUUI closeBatchBarcodeScannerWithResultDelegate: [self createResultDelegate:resolve reject:reject]];
|
|
74
|
+
});
|
|
77
75
|
}
|
|
78
76
|
|
|
79
77
|
RCT_EXPORT_METHOD(startBarcodeScannerV2:(NSString*)configuration:(BOOL)barcodeItemMapperImplemented
|
|
@@ -81,64 +79,75 @@ RCT_EXPORT_METHOD(startBarcodeScannerV2:(NSString*)configuration:(BOOL)barcodeIt
|
|
|
81
79
|
withRejecter:(RCTPromiseRejectBlock)reject) {
|
|
82
80
|
|
|
83
81
|
runOnMainThread(^{
|
|
84
|
-
UIViewController *presentedViewController =
|
|
85
|
-
|
|
82
|
+
UIViewController *presentedViewController = [self parentViewController:reject];
|
|
86
83
|
if (presentedViewController == NULL) {
|
|
87
|
-
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
ScanbotBarcodeSdkPluginResultDelegate* delegate = [self createResultDelegate:resolve reject:reject];
|
|
88
|
+
|
|
89
|
+
if (barcodeItemMapperImplemented) {
|
|
90
|
+
[SBBRTUUI startBarcodeScannerV2WithParentViewController:presentedViewController
|
|
91
|
+
configurationString:configuration
|
|
92
|
+
resultDelegate:delegate
|
|
93
|
+
mapBarcodeItemCallback: ^(NSDictionary<NSString *,id> * _Nonnull barcodeItem) {
|
|
94
|
+
[self sendEventWithName:BarcodeItemMapperEvent body:barcodeItem];
|
|
95
|
+
}];
|
|
88
96
|
} else {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
if (barcodeItemMapperImplemented) {
|
|
94
|
-
[SBBWrapperOperations startBarcodeScannerV2WithParentViewController:presentedViewController configurationAsDictionary:configurationAsDictionary resultDelegate:[self createResultDelegate:resolve reject:reject] mapBarcodeItemCallback:^(NSDictionary<NSString *,id> * _Nonnull barcodeItem) {
|
|
95
|
-
[self sendEventWithName:BarcodeItemMapperEvent body:barcodeItem];
|
|
96
|
-
}];
|
|
97
|
-
} else {
|
|
98
|
-
[SBBWrapperOperations startBarcodeScannerV2WithParentViewController:presentedViewController configurationAsDictionary:configurationAsDictionary resultDelegate:[self createResultDelegate:resolve reject:reject] mapBarcodeItemCallback: nil];
|
|
99
|
-
}
|
|
100
|
-
} else {
|
|
101
|
-
NSString * message = jsonError != NULL ? jsonError.userInfo.description : @"Unknown error while deserialization";
|
|
102
|
-
|
|
103
|
-
reject(@"", message, nil);
|
|
104
|
-
}
|
|
97
|
+
[SBBRTUUI startBarcodeScannerV2WithParentViewController:presentedViewController
|
|
98
|
+
configurationString:configuration
|
|
99
|
+
resultDelegate:delegate
|
|
100
|
+
mapBarcodeItemCallback:nil];
|
|
105
101
|
}
|
|
102
|
+
|
|
106
103
|
});
|
|
107
104
|
}
|
|
108
105
|
|
|
109
106
|
RCT_EXPORT_METHOD(closeBarcodeScannerV2:
|
|
110
107
|
(RCTPromiseResolveBlock)resolve
|
|
111
108
|
withRejecter:(RCTPromiseRejectBlock)reject) {
|
|
112
|
-
|
|
113
|
-
[SBBWrapperOperations closeBarcodeScannerV2WithResultDelegate: [self createResultDelegate:resolve reject:reject]];
|
|
109
|
+
[SBBRTUUI closeBarcodeScannerV2WithResultDelegate: [self createResultDelegate:resolve reject:reject]];
|
|
114
110
|
}
|
|
115
111
|
|
|
112
|
+
|
|
116
113
|
RCT_EXPORT_METHOD(onBarcodeItemMapper:(NSString*)barcodeItem:(NSDictionary * _Nullable)barcodeMappedData) {
|
|
117
|
-
|
|
118
|
-
NSError * _Nullable jsonError;
|
|
119
|
-
NSDictionary<NSString *, id> * _Nullable barcodeItemAsDictionary = [DictionaryHelper fromJSONString:barcodeItem error:&jsonError];
|
|
120
|
-
|
|
121
|
-
[SBBWrapperOperations onBarcodeItemMapperWithBarcodeItemAsDictionary:barcodeItemAsDictionary barcodeMappedDataAsDictionary:barcodeMappedData];
|
|
114
|
+
[SBBRTUUI onBarcodeItemMapperWithBarcodeItemUUID:barcodeItem barcodeMappedDataAsDictionary:barcodeMappedData];
|
|
122
115
|
}
|
|
123
116
|
|
|
124
117
|
RCT_EXPORT_METHOD(detectBarcodesOnImage:(NSDictionary *)args
|
|
125
118
|
withResolver:(RCTPromiseResolveBlock)resolve
|
|
126
119
|
withRejecter:(RCTPromiseRejectBlock)reject) {
|
|
127
120
|
|
|
128
|
-
[
|
|
121
|
+
[SBBOperations detectBarcodesOnImageWithOptionsConfig:args resultDelegate:[self createResultDelegate:resolve reject:reject]];
|
|
129
122
|
}
|
|
130
123
|
|
|
131
124
|
RCT_EXPORT_METHOD(extractImagesFromPDF:(NSDictionary *)args
|
|
132
125
|
withResolver:(RCTPromiseResolveBlock)resolve
|
|
133
126
|
withRejecter:(RCTPromiseRejectBlock)reject) {
|
|
134
127
|
|
|
135
|
-
[
|
|
128
|
+
[SBBOperations extractImagesFromPDFWithOptionsConfig:args resultDelegate:[self createResultDelegate:resolve reject:reject]];
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
RCT_EXPORT_METHOD(getImageData:(NSString *)imageFileUri
|
|
132
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
133
|
+
withRejecter:(RCTPromiseRejectBlock)reject) {
|
|
134
|
+
[SBBOperations getImageDataWithImageFilePath:imageFileUri resultDelegate:[self createResultDelegate:resolve reject:reject]];
|
|
136
135
|
}
|
|
137
136
|
|
|
138
137
|
- (ScanbotBarcodeSdkPluginResultDelegate*) createResultDelegate: (RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
|
|
139
138
|
return [[ScanbotBarcodeSdkPluginResultDelegate alloc] initWithResolveBlock:resolve andRejectBlock:reject];
|
|
140
139
|
}
|
|
141
140
|
|
|
141
|
+
- (UIViewController* _Nullable) parentViewController:(RCTPromiseRejectBlock)reject {
|
|
142
|
+
UIViewController *presentedViewController = RCTPresentedViewController();
|
|
143
|
+
if (presentedViewController == NULL) {
|
|
144
|
+
reject(@"RTUUI_ERROR", @"No active view controller", nil);
|
|
145
|
+
return NULL;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return presentedViewController;
|
|
149
|
+
}
|
|
150
|
+
|
|
142
151
|
+ (BOOL)requiresMainQueueSetup
|
|
143
152
|
{
|
|
144
153
|
return NO;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#import <React/RCTBridgeModule.h>
|
|
2
2
|
#import <ScanbotBarcodeSDKWrapper/ScanbotBarcodeSDKWrapper-Swift.h>
|
|
3
3
|
|
|
4
|
-
@interface ScanbotBarcodeSdkPluginResultDelegate : NSObject<
|
|
4
|
+
@interface ScanbotBarcodeSdkPluginResultDelegate : NSObject<PluginResultDelegate>
|
|
5
5
|
|
|
6
6
|
- (instancetype)initWithResolveBlock:(RCTPromiseResolveBlock)resolve andRejectBlock:(RCTPromiseRejectBlock)reject;
|
|
7
7
|
- (instancetype)init NS_UNAVAILABLE;
|
|
@@ -3,27 +3,27 @@
|
|
|
3
3
|
@implementation ScanbotBarcodeSdkPluginResultDelegate {
|
|
4
4
|
RCTPromiseResolveBlock resolveBlock;
|
|
5
5
|
RCTPromiseRejectBlock rejectBlock;
|
|
6
|
-
ScanbotBarcodeSdkPluginResultDelegate* _instance;
|
|
7
6
|
}
|
|
8
7
|
|
|
9
8
|
- (instancetype)initWithResolveBlock:(RCTPromiseResolveBlock)resolve andRejectBlock:(RCTPromiseRejectBlock)reject {
|
|
10
9
|
self = [super init];
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return self;
|
|
10
|
+
if (self) {
|
|
11
|
+
resolveBlock = resolve;
|
|
12
|
+
rejectBlock = reject;
|
|
13
|
+
}
|
|
14
|
+
return self;
|
|
17
15
|
}
|
|
18
16
|
|
|
19
|
-
- (void)
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
- (void)didRejectPromise:(NSDictionary<NSString *,id> * _Nonnull)error {
|
|
18
|
+
NSString* message = @"An unexpected error has occured";
|
|
19
|
+
if([error objectForKey:@"message"]){
|
|
20
|
+
message = [error objectForKey:(@"message")];
|
|
21
|
+
}
|
|
22
|
+
rejectBlock(@"ScanbotSDKError", message, nil);
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
- (void)
|
|
25
|
-
|
|
26
|
-
_instance = nil;
|
|
25
|
+
- (void)didResolvePromise:(NSDictionary<NSString *,id> * _Nonnull)result {
|
|
26
|
+
resolveBlock(result);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
@end
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_codegenNativeComponent","_interopRequireDefault","require","_codegenNativeCommands","e","__esModule","default","_default","exports","codegenNativeComponent","Commands","codegenNativeCommands","supportedCommands"],"sourceRoot":"../../../../src","sources":["component/spec/ScanbotBarcodeScannerViewNativeComponent.ts"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AASA,IAAAC,sBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAA2F,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,
|
|
1
|
+
{"version":3,"names":["_codegenNativeComponent","_interopRequireDefault","require","_codegenNativeCommands","e","__esModule","default","_default","exports","codegenNativeComponent","Commands","codegenNativeCommands","supportedCommands"],"sourceRoot":"../../../../src","sources":["component/spec/ScanbotBarcodeScannerViewNativeComponent.ts"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AASA,IAAAC,sBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAA2F,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GA0D5E,IAAAG,+BAAsB,EAAc,2BAA2B,CAAC;AAWxE,MAAMC,QAAQ,GAAAF,OAAA,CAAAE,QAAA,GAAG,IAAAC,8BAAqB,EAAiB;EAC5DC,iBAAiB,EAAE,CAAC,cAAc,EAAE,gBAAgB,EAAE,uBAAuB;AAC/E,CAAC,CAAC","ignoreList":[]}
|