react-native-scanbot-barcode-scanner-sdk 3.7.0 → 3.7.1-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.
Files changed (170) hide show
  1. package/RNScanbotBarcodeSDK.podspec +12 -9
  2. package/android/build.gradle +31 -27
  3. package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  4. package/android/src/main/AndroidManifest.xml +1 -2
  5. package/android/src/main/java/com/reactlibrary/ScanbotBarcodeSdkModule.java +5 -12
  6. package/android/src/main/java/com/reactlibrary/ScanbotBarcodeSdkPackage.java +2 -2
  7. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ObjectMapper.java +24 -17
  8. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkConfiguration.java +5 -2
  9. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule.java +92 -84
  10. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkPackage.java +1 -2
  11. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/StorageUtils.java +5 -69
  12. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/barcode/ScanbotBarcodeDetectorAdditionalConfigBuilder.java +1 -1
  13. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/barcode/ScanbotBarcodeDetectorConfigBuilder.java +1 -1
  14. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraView.java +9 -15
  15. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewConfiguration.java +6 -5
  16. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/base/communication/ScanbotEventEmitter.java +5 -3
  17. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/base/communication/ScanbotEventReceiver.java +15 -4
  18. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/JSONUtils.java +29 -40
  19. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/LogUtils.java +4 -1
  20. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/ResponseUtils.java +2 -10
  21. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/ScanbotViewUtils.java +0 -17
  22. package/android/src/new-architecture/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewManager.java +127 -0
  23. package/android/src/{main/java → old-architecture}/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewManager.java +1 -1
  24. package/index.js +1 -1
  25. package/ios/Categories/SBSDKPolygon+JSON.h +1 -1
  26. package/ios/Categories/SBSDKPolygon+JSON.m +1 -1
  27. package/ios/Categories/UIColor+JSON.h +1 -1
  28. package/ios/Categories/UIColor+JSON.m +1 -1
  29. package/ios/Components/BarcodeCameraView/NewArchitecture/RTNScanbotBarcodeCameraView.h +45 -0
  30. package/ios/Components/BarcodeCameraView/NewArchitecture/RTNScanbotBarcodeCameraView.mm +364 -0
  31. package/ios/Components/BarcodeCameraView/NewArchitecture/RTNScanbotBarcodeCameraViewManager.mm +71 -0
  32. package/ios/Components/BarcodeCameraView/{RNScanbotBarcodeCameraView.h → OldArchitecture/RNScanbotBarcodeCameraView.h} +9 -4
  33. package/ios/Components/BarcodeCameraView/{RNScanbotBarcodeCameraView.m → OldArchitecture/RNScanbotBarcodeCameraView.mm} +24 -34
  34. package/ios/Components/BarcodeCameraView/{RNScanbotBarcodeCameraViewManager.h → OldArchitecture/RNScanbotBarcodeCameraViewManager.h} +7 -1
  35. package/ios/Components/BarcodeCameraView/{RNScanbotBarcodeCameraViewManager.m → OldArchitecture/RNScanbotBarcodeCameraViewManager.mm} +25 -6
  36. package/ios/ScanbotBarcodeSDKConfiguration.h +1 -1
  37. package/ios/ScanbotBarcodeSDKConfiguration.m +1 -1
  38. package/ios/ScanbotBarcodeSdk.h +2 -2
  39. package/ios/ScanbotBarcodeSdk.m +24 -23
  40. package/ios/SharedConfiguration.h +1 -1
  41. package/ios/SharedConfiguration.m +1 -1
  42. package/ios/Utils/BarcodeMapping.h +40 -33
  43. package/ios/Utils/HashUtils.h +1 -1
  44. package/ios/Utils/JSONMappings.h +1 -1
  45. package/ios/Utils/LoggingUtils.h +1 -1
  46. package/ios/Utils/ObjectMapper.h +1 -1
  47. package/ios/Utils/ObjectMapper.m +1 -1
  48. package/ios/Utils/ReactBarcodeExtensionsFilter.h +1 -1
  49. package/ios/Utils/ScanbotStorageUtils.h +1 -1
  50. package/ios/Utils/ScanbotStorageUtils.m +1 -1
  51. package/js/RTNScanbotBarcodeCameraViewNativeComponent.tsx +209 -0
  52. package/package.json +22 -2
  53. package/src/components/barcode-camera-view/scanbot-barcode-camera-view-types.tsx +8 -1
  54. package/src/components/barcode-camera-view/scanbot-barcode-camera-view.tsx +46 -12
  55. package/src/components/barcode-camera-view/scanbot-native-barcode-camera-view.tsx +7 -5
  56. package/src/configuration.ts +4 -1
  57. package/src/enum.ts +1 -1
  58. package/android/.gradle/6.1.1/executionHistory/executionHistory.bin +0 -0
  59. package/android/.gradle/6.1.1/executionHistory/executionHistory.lock +0 -0
  60. package/android/.gradle/6.1.1/fileChanges/last-build.bin +0 -0
  61. package/android/.gradle/6.1.1/fileHashes/fileHashes.bin +0 -0
  62. package/android/.gradle/6.1.1/fileHashes/fileHashes.lock +0 -0
  63. package/android/.gradle/6.1.1/gc.properties +0 -0
  64. package/android/.gradle/6.2/executionHistory/executionHistory.lock +0 -0
  65. package/android/.gradle/6.2/fileChanges/last-build.bin +0 -0
  66. package/android/.gradle/6.2/fileHashes/fileHashes.lock +0 -0
  67. package/android/.gradle/6.2/gc.properties +0 -0
  68. package/android/.gradle/6.8/executionHistory/executionHistory.lock +0 -0
  69. package/android/.gradle/6.8/fileChanges/last-build.bin +0 -0
  70. package/android/.gradle/6.8/fileHashes/fileHashes.lock +0 -0
  71. package/android/.gradle/6.8/gc.properties +0 -0
  72. package/android/.gradle/7.0-rc-1/dependencies-accessors/dependencies-accessors.lock +0 -0
  73. package/android/.gradle/7.0-rc-1/dependencies-accessors/gc.properties +0 -0
  74. package/android/.gradle/7.0-rc-1/fileChanges/last-build.bin +0 -0
  75. package/android/.gradle/7.0-rc-1/fileHashes/fileHashes.lock +0 -0
  76. package/android/.gradle/7.0-rc-1/gc.properties +0 -0
  77. package/android/.gradle/7.1.1/dependencies-accessors/dependencies-accessors.lock +0 -0
  78. package/android/.gradle/7.1.1/dependencies-accessors/gc.properties +0 -0
  79. package/android/.gradle/7.1.1/executionHistory/executionHistory.lock +0 -0
  80. package/android/.gradle/7.1.1/fileChanges/last-build.bin +0 -0
  81. package/android/.gradle/7.1.1/fileHashes/fileHashes.lock +0 -0
  82. package/android/.gradle/7.1.1/gc.properties +0 -0
  83. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  84. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  85. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  86. package/android/.gradle/checksums/checksums.lock +0 -0
  87. package/android/.gradle/checksums/md5-checksums.bin +0 -0
  88. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  89. package/android/.gradle/configuration-cache/gc.properties +0 -0
  90. package/android/.gradle/vcs-1/gc.properties +0 -0
  91. package/android/build/.transforms/8cdb68f56773f65afa4976aa86d988f7/classes/classes.dex +0 -0
  92. package/android/build/.transforms/8cdb68f56773f65afa4976aa86d988f7.bin +0 -1
  93. package/android/build/.transforms/991094845a707011dcf91007d9838bb7/classes/classes.dex +0 -0
  94. package/android/build/.transforms/991094845a707011dcf91007d9838bb7.bin +0 -1
  95. package/android/build/generated/source/buildConfig/debug/io/scanbot/barcodesdk/plugin/reactnative/BuildConfig.java +0 -18
  96. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +0 -11
  97. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output.json +0 -1
  98. package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +0 -1
  99. package/android/build/intermediates/compile_library_classes/debug/classes.jar +0 -0
  100. package/android/build/intermediates/compile_only_not_namespaced_r_class_jar/debug/R.jar +0 -0
  101. package/android/build/intermediates/incremental/debug-mergeNativeLibs/merge-state +0 -0
  102. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
  103. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
  104. package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
  105. package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +0 -4
  106. package/android/build/intermediates/incremental/packageDebugResources/merger.xml +0 -2
  107. package/android/build/intermediates/javac/debug/classes/com/reactlibrary/ScanbotBarcodeSdkModule.class +0 -0
  108. package/android/build/intermediates/javac/debug/classes/com/reactlibrary/ScanbotBarcodeSdkPackage.class +0 -0
  109. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/BitmapHelper.class +0 -0
  110. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/BuildConfig.class +0 -0
  111. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/JSONUtils$WritableMapBuilder.class +0 -0
  112. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/JSONUtils.class +0 -0
  113. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/LogUtils.class +0 -0
  114. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ObjectMapper.class +0 -0
  115. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ReactBarcodeExtensionsFilter$1.class +0 -0
  116. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ReactBarcodeExtensionsFilter$Type.class +0 -0
  117. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ReactBarcodeExtensionsFilter.class +0 -0
  118. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ResponseUtils.class +0 -0
  119. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkConfiguration.class +0 -0
  120. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule$1.class +0 -0
  121. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule$2.class +0 -0
  122. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule$3.class +0 -0
  123. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule.class +0 -0
  124. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkPackage.class +0 -0
  125. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/StorageUtils.class +0 -0
  126. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/barcode/ScanbotBarcodeDetectorAdditionalConfigBuilder.class +0 -0
  127. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/barcode/ScanbotBarcodeDetectorConfigBuilder.class +0 -0
  128. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/EventEmitter$NativeEvent.class +0 -0
  129. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/EventEmitter.class +0 -0
  130. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewConfiguration.class +0 -0
  131. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewFragment$1.class +0 -0
  132. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewFragment$2.class +0 -0
  133. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewFragment.class +0 -0
  134. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewManager$1$1$1.class +0 -0
  135. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewManager$1$1.class +0 -0
  136. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewManager$1.class +0 -0
  137. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewManager.class +0 -0
  138. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/common/ScanbotComponentFrameLayout$1.class +0 -0
  139. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/common/ScanbotComponentFrameLayout$ILayoutChangeListener.class +0 -0
  140. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/common/ScanbotComponentFrameLayout.class +0 -0
  141. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/common/ScanbotComponentRootView$1.class +0 -0
  142. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/common/ScanbotComponentRootView$2.class +0 -0
  143. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/common/ScanbotComponentRootView$ILayoutChangeListener.class +0 -0
  144. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/common/ScanbotComponentRootView$IOnChildRemovedListener.class +0 -0
  145. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/common/ScanbotComponentRootView.class +0 -0
  146. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/filters/ReactBarcodeExtensionsFilter$1.class +0 -0
  147. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/filters/ReactBarcodeExtensionsFilter$Type.class +0 -0
  148. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/filters/ReactBarcodeExtensionsFilter.class +0 -0
  149. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/utils/BitmapHelper.class +0 -0
  150. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/utils/JSONUtils$WritableMapBuilder.class +0 -0
  151. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/utils/JSONUtils.class +0 -0
  152. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/utils/LogUtils.class +0 -0
  153. package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/utils/ResponseUtils.class +0 -0
  154. package/android/build/intermediates/library_java_res/debug/res.jar +0 -0
  155. package/android/build/intermediates/library_manifest/debug/AndroidManifest.xml +0 -11
  156. package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLibraryResources/R-def.txt +0 -9
  157. package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +0 -13
  158. package/android/build/intermediates/merged_manifests/debug/output.json +0 -1
  159. package/android/build/intermediates/packaged_res/debug/drawable/ic_baseline_arrow_back_24.xml +0 -10
  160. package/android/build/intermediates/packaged_res/debug/layout/component_barcode_camera_view.xml +0 -11
  161. package/android/build/intermediates/packaged_res/debug/layout/fragment_barcode_scanner.xml +0 -23
  162. package/android/build/intermediates/res/symbol-table-with-package/debug/package-aware-r.txt +0 -3560
  163. package/android/build/intermediates/runtime_library_classes/debug/classes.jar +0 -0
  164. package/android/build/intermediates/symbols/debug/R.txt +0 -5107
  165. package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -37
  166. package/android/local.properties +0 -8
  167. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ReactBarcodeExtensionsFilter.java +0 -61
  168. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/BitmapHelper.java +0 -30
  169. package/ios/ScanbotBarcodeSdk.xcodeproj/xcuserdata/mayankpatil.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
  170. package/ios/ScanbotBarcodeSdk.xcworkspace/xcuserdata/mayankpatil.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
@@ -1,7 +1,7 @@
1
1
  //
2
2
  // Scanbot Barcode Scanner SDK React Native Plugin
3
3
  //
4
- // Copyright (c) 2020 doo GmbH. All rights reserved.
4
+ // Copyright (c) 2023 Scanbot SDK GmbH. All rights reserved.
5
5
  // https://scanbot.io/sdk
6
6
  //
7
7
 
@@ -1,7 +1,7 @@
1
1
  //
2
2
  // Scanbot Barcode Scanner SDK React Native Plugin
3
3
  //
4
- // Copyright (c) 2020 doo GmbH. All rights reserved.
4
+ // Copyright (c) 2023 Scanbot SDK GmbH. All rights reserved.
5
5
  // https://scanbot.io/sdk
6
6
  //
7
7
  #import "ObjectMapper.h"
@@ -6,7 +6,7 @@
6
6
  //
7
7
 
8
8
  #import <Foundation/Foundation.h>
9
- @import ScanbotBarcodeScannerSDK;
9
+ #import <ScanbotBarcodeScannerSDK/ScanbotBarcodeScannerSDK.h>
10
10
 
11
11
  typedef enum BarcodeFilterType : NSUInteger {
12
12
  ReactBarcodeExtensionsFilterWithExtension,
@@ -1,7 +1,7 @@
1
1
  //
2
2
  // Scanbot Barcode Scanner SDK React Native Plugin
3
3
  //
4
- // Copyright (c) 2020 doo GmbH. All rights reserved.
4
+ // Copyright (c) 2023 Scanbot SDK GmbH. All rights reserved.
5
5
  // https://scanbot.io/sdk
6
6
  //
7
7
 
@@ -1,7 +1,7 @@
1
1
  //
2
2
  // Scanbot Barcode Scanner SDK React Native Plugin
3
3
  //
4
- // Copyright (c) 2020 doo GmbH. All rights reserved.
4
+ // Copyright (c) 2023 Scanbot SDK GmbH. All rights reserved.
5
5
  // https://scanbot.io/sdk
6
6
  //
7
7
 
@@ -0,0 +1,209 @@
1
+ import { ComponentType } from 'react';
2
+ import type {HostComponent, ViewProps} from 'react-native';
3
+ import { BubblingEventHandler, DirectEventHandler, Float, Int32 } from 'react-native/Libraries/Types/CodegenTypes';
4
+ import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
5
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
6
+
7
+ export interface NativeProps extends ViewProps {
8
+ configuration?: ScanbotBarcodeCameraViewConfiguration;
9
+ // Lifecycle methods
10
+ onComponentDidUpdate: DirectEventHandler<Readonly<{}>>;
11
+ onComponentDidMount: DirectEventHandler<Readonly<{}>>;
12
+ onComponentWillUnmount: DirectEventHandler<Readonly<{}>>;
13
+ onOrientationChanged: DirectEventHandler<Readonly<{}>>;
14
+ onNativeBarcodeScannerResult: BubblingEventHandler<Readonly<{jsonResult: string}>>;
15
+ }
16
+
17
+ export default codegenNativeComponent<NativeProps>(
18
+ 'RTNScanbotBarcodeCameraView',
19
+ ) as HostComponent<NativeProps>;
20
+
21
+ interface NativeCommands {
22
+ componentDidUpdate: (viewRef: React.ElementRef<ComponentType>) => void;
23
+ componentDidMount: (viewRef: React.ElementRef<ComponentType>) => void;
24
+ componentWillUnmount: (viewRef: React.ElementRef<ComponentType>) => void;
25
+ orientationChanged: (viewRef: React.ElementRef<ComponentType>) => void;
26
+ }
27
+ // Execute codegeNativeCommands function with proper supportedCommands
28
+ // as shown below and export it
29
+ export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
30
+ supportedCommands: ['componentDidUpdate', 'componentDidMount', 'componentWillUnmount', 'orientationChanged'],
31
+ });
32
+
33
+ /**
34
+ * This class contians all the configurations needed for Scanbot Barcode Camera View.
35
+ */
36
+ export interface ScanbotBarcodeCameraViewConfiguration extends FinderConfig, BarcodeAdditionalParameters {
37
+ /**
38
+ * Whether flash is toggled on or off.
39
+ */
40
+ flashEnabled?: boolean;
41
+ /**
42
+ * List of accepted Barcode Formats; any formats that are not included in this
43
+ * list will not be detected by the `BarcodeCameraView`. By default, the list
44
+ * includes all supported barcode types.
45
+ */
46
+ barcodeFormats?: string[]; // TODO: Should be BarcodeFormat[]
47
+ /**
48
+ * An optional array of barcode document formats that acts as a detection filter.
49
+ * By default all supported document formats will be detected.
50
+ */
51
+ // acceptedDocumentFormats?: BarcodeDocumentFormat[];
52
+ /**
53
+ * The engine mode of the barcode recognizer. Defaults to NEXT_GEN.
54
+ * To use legacy recognizer, please specify LEGACY
55
+ */
56
+ engineMode?: string; // TODO: Should be EngineMode
57
+ /**
58
+ * The relative initial zoom level of the camera in the range [0,1], where 0 is zoomed out and 1 is zoomed in.
59
+ * The default value is 0.-
60
+ */
61
+ cameraZoomFactor?: Float;
62
+ /**
63
+ * Use a filter to determine which type of barcode can be detected; see `BarcodeFilter`
64
+ */
65
+ barcodeFilter?: string; // TODO: Should be BarcodeFilter
66
+ }
67
+
68
+ export type NativeComponentBarcodeFormat =
69
+ 'AZTEC' |
70
+ 'CODABAR' |
71
+ 'CODE_39' |
72
+ 'CODE_93' |
73
+ 'CODE_128' |
74
+ 'DATA_MATRIX' |
75
+ 'EAN_8' |
76
+ 'EAN_13' |
77
+ 'ITF' |
78
+ 'PDF_417' |
79
+ 'QR_CODE' |
80
+ 'RSS_14' |
81
+ 'RSS_EXPANDED' |
82
+ 'UPC_A' |
83
+ 'UPC_E' |
84
+ 'UNKNOWN' |
85
+ 'IATA_2_OF_5' |
86
+ 'INDUSTRIAL_2_OF_5' |
87
+ 'MSI_PLESSEY' |
88
+ 'CODE_25';
89
+
90
+
91
+ /**
92
+ * An interface that contains additional parameters for barcodes detection and filtering.
93
+ */
94
+ export interface BarcodeAdditionalParameters {
95
+ /**
96
+ * If `true`, enables the mode which slightly decreases the scanning quality and the energy consumption, thus increasing the scanning speed.
97
+ * The default is `false`.
98
+ * Android only.
99
+ */
100
+ lowPowerMode?: boolean;
101
+ /**
102
+ * Optional minimum required text length of the detected barcode.
103
+ * The default is 0 (setting is turned off).
104
+ * NOTE: This feature works on ITF and MSI Plessey barcodes only.
105
+ */
106
+ minimumTextLength?: Int32;
107
+ /**
108
+ * Optional maximum required text length of the detected barcode.
109
+ * The default is 0 (setting is turned off).
110
+ * NOTE: This feature works on ITF and MSI Plessey barcodes only.
111
+ */
112
+ maximumTextLength?: Int32;
113
+ /**
114
+ * Optional minimum required quiet zone on the barcode.
115
+ * Measured in modules (the size of narrowest bar in the barcode).
116
+ * The default is 10.
117
+ * NOTE: This feature works on ITF and MSI Plessey barcodes only.
118
+ */
119
+ minimum1DBarcodesQuietZone?: Int32;
120
+ /**
121
+ * With this option enabled, the scanner removes check digits for UPC, EAN and MSI Plessey codes.
122
+ * Has no effect if both single and double digit MSI Plessey checksums are enabled.
123
+ * The default is `false`.
124
+ */
125
+ stripCheckDigits?: boolean;
126
+ /**
127
+ * When set to `true`, the scanner assumes that the barcode can be a GS1 barcode.
128
+ * Turn it off if you don't want to see decoded FNC1 characters (']C1' and ASCII char 29).
129
+ * The default value is `true`.
130
+ * NOTE: Currently works for CODE128 barcodes only!
131
+ */
132
+ gs1DecodingEnabled?: boolean;
133
+ /**
134
+ * The checksum algorithm for MSI Plessey barcodes.
135
+ * The default value is [MSIPlesseyChecksumAlgorithm.Mod10].
136
+ */
137
+ msiPlesseyChecksumAlgorithm?: string; // TODO: Should be MSIPlesseyChecksumAlgorithm
138
+ /**
139
+ * Low density. Finds up to 6 QR codes in one image or video frame. This is the default value.
140
+ * High density. Finds up to 24 QR codes in one image or video frame.
141
+ */
142
+ codeDensity?: string; // TODO: Should be CodeDensity
143
+ }
144
+
145
+ /**
146
+ * This class contains all the finder configurations.
147
+ */
148
+ export interface FinderConfig {
149
+
150
+ /**
151
+ * The finder view is a rectangular overlay view that clips the camera view,
152
+ * so that the detection will focus just a specific area. You can specify
153
+ * the size and positioning, as well as other UI properties.
154
+ * Set this property to `true` if you want to use the Finder View, `false` otherwise (default: false)
155
+ */
156
+ shouldUseFinderView?: boolean;
157
+ /**
158
+ * The finder view rectangular overlay border width
159
+ */
160
+ finderLineWidth?: Int32;
161
+ /**
162
+ * The finder view rectangular overlay border color
163
+ */
164
+ finderLineColor?: string;
165
+ /**
166
+ * The overlay background color, around the finder view rectangle
167
+ */
168
+ finderBackgroundColor?: string;
169
+ /**
170
+ * The overlay background color opacity, around the finder view rectangle
171
+ */
172
+ finderBackgroundOpacity?: Float;
173
+ /**
174
+ * The finder view rectangle aspect ratio
175
+ */
176
+ finderAspectRatio?: FinderAspectRatio;
177
+ /**
178
+ * Set the finderInsets left, top, bottom, right
179
+ */
180
+ finderInset?: FinderInset
181
+ }
182
+
183
+ /**
184
+ * This class contains properties to Set the finder insets for the finder view.
185
+ */
186
+ export interface FinderInset {
187
+
188
+ /**
189
+ * Set the left inset
190
+ */
191
+ left: Float;
192
+ /**
193
+ * Set the top inset
194
+ */
195
+ top: Float;
196
+ /**
197
+ * Set the bottom inset
198
+ */
199
+ bottom: Float;
200
+ /**
201
+ * Set the right inset
202
+ */
203
+ right: Float;
204
+ }
205
+
206
+ export interface FinderAspectRatio {
207
+ width: Int32;
208
+ height: Int32;
209
+ }
package/package.json CHANGED
@@ -1,9 +1,15 @@
1
1
  {
2
2
  "name": "react-native-scanbot-barcode-scanner-sdk",
3
3
  "title": "Scanbot Barcode Scanner SDK for React Native",
4
- "version": "3.7.0",
4
+ "version": "3.7.1-beta.2",
5
+ "scanbot": {
6
+ "iosVersion": "4.0.0"
7
+ },
5
8
  "description": "Scanbot Barcode Scanner SDK React Native Plugin for Android and iOS",
6
9
  "main": "index.js",
10
+ "scripts": {
11
+ "prepack": "node prepare-podspec.js"
12
+ },
7
13
  "files": [
8
14
  "src/*.js",
9
15
  "src/*.ts",
@@ -12,6 +18,7 @@
12
18
  "src/components/**/*.js",
13
19
  "android/**",
14
20
  "ios/**",
21
+ "js/**",
15
22
  "index.d.ts",
16
23
  "index.js",
17
24
  "README.md",
@@ -48,6 +55,10 @@
48
55
  "devDependencies": {
49
56
  "@types/react": "^18.2.6",
50
57
  "@types/react-native": "^0.72.0",
58
+ "chalk": "^5.3.0",
59
+ "cli-spinner": "^0.2.10",
60
+ "log-update": "^5.0.1",
61
+ "nunjucks": "^3.2.4",
51
62
  "react": "^18.2.0",
52
63
  "react-native": "^0.71.8"
53
64
  },
@@ -57,5 +68,14 @@
57
68
  "email": "sdk@scanbot.io",
58
69
  "url": "https://scanbot.io"
59
70
  }
60
- ]
71
+ ],
72
+ "react-native": "index",
73
+ "codegenConfig": {
74
+ "name": "RTNScanbotBarcodeCameraViewSpecs",
75
+ "type": "components",
76
+ "jsSrcsDir": "js",
77
+ "android": {
78
+ "javaPackageName": "io.scanbot.barcodesdk.plugin.reactnative"
79
+ }
80
+ }
61
81
  }
@@ -12,10 +12,17 @@ import { BarcodeAdditionalParameters } from '../../configuration';
12
12
 
13
13
  export interface ScanbotBarcodeCameraViewProperties {
14
14
  onBarcodeScannerResult?: (result: BarcodeResult) => void;
15
+ configuration?: ScanbotBarcodeCameraViewConfiguration;
16
+ style: StyleProp<ViewStyle>;
17
+ children?: React.ReactNode;
18
+ }
19
+
20
+ export interface ScanbotBarcodeCameraNativeViewProperties {
21
+ onNativeBarcodeScannerResult?: (result: BarcodeResult) => void;
15
22
  requestComponentReload?: () => void;
16
23
  configuration?: ScanbotBarcodeCameraViewConfiguration;
17
24
  style: StyleProp<ViewStyle>;
18
- children: React.ReactNode;
25
+ children?: React.ReactNode;
19
26
  }
20
27
 
21
28
  export interface ScanbotBarcodeCameraViewBarcode {
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
2
  import { EmitterSubscription, findNodeHandle, NativeMethods, Platform, UIManager } from 'react-native';
3
3
  import { Dimensions } from 'react-native';
4
- import { ScanbotBarcodeCameraViewProperties } from './scanbot-barcode-camera-view-types';
5
- import ScanbotNativeBarcodeCameraView from './scanbot-native-barcode-camera-view';
4
+ import { ScanbotBarcodeCameraNativeViewProperties, ScanbotBarcodeCameraViewConfiguration, ScanbotBarcodeCameraViewProperties } from './scanbot-barcode-camera-view-types';
5
+ import ScanbotNativeBarcodeCameraView, { Commands } from './scanbot-native-barcode-camera-view';
6
+ import { BarcodeResult } from '../../result';
6
7
 
7
8
  const Device = {
8
9
  isPortrait: () => {
@@ -23,7 +24,7 @@ type Properties = ScanbotBarcodeCameraViewProperties;
23
24
  export class ScanbotBarcodeCameraView extends React.Component<Properties, {}> {
24
25
 
25
26
  // Camera View Reference
26
- cameraViewReference: React.RefObject<React.Component<ScanbotBarcodeCameraViewProperties> & Readonly<NativeMethods>>
27
+ cameraViewReference: React.RefObject<React.Component<ScanbotBarcodeCameraNativeViewProperties> & Readonly<NativeMethods>>
27
28
 
28
29
  // String length of auto-generated component key
29
30
  static UNIQUE_VIEW_KEY_LENGTH = 6;
@@ -93,13 +94,30 @@ export class ScanbotBarcodeCameraView extends React.Component<Properties, {}> {
93
94
  });
94
95
  };
95
96
 
97
+ receiveEvent(event: any) {}
98
+
96
99
  // Maps the native bridge callback event from the Barcode Scanner
97
100
  _onBarcodeScannerResult = (event: any) => {
98
101
  if (!this.props.onBarcodeScannerResult) {
99
102
  return;
100
103
  }
101
104
 
102
- this.props.onBarcodeScannerResult(event.nativeEvent.result);
105
+ let outResult: BarcodeResult | undefined = undefined;
106
+ if (Platform.OS === 'ios') {
107
+ // The new-architecture Fabric Component callback returns a JSON string as a result
108
+ if (event.nativeEvent.jsonResult) {
109
+ outResult = JSON.parse(event.nativeEvent.jsonResult)?.result;
110
+ } else {
111
+ // Support for the old architecture
112
+ outResult = event.nativeEvent.result;
113
+ }
114
+ } else {
115
+ outResult = event.nativeEvent.result;
116
+ }
117
+
118
+ if (outResult) {
119
+ this.props.onBarcodeScannerResult(outResult);
120
+ }
103
121
  };
104
122
 
105
123
  render() {
@@ -115,7 +133,7 @@ export class ScanbotBarcodeCameraView extends React.Component<Properties, {}> {
115
133
  style={style}
116
134
  key={this.cameraKey}
117
135
  ref={this.cameraViewReference}
118
- onBarcodeScannerResult={this._onBarcodeScannerResult}
136
+ onNativeBarcodeScannerResult={this._onBarcodeScannerResult}
119
137
  />
120
138
  );
121
139
  }
@@ -170,9 +188,28 @@ export class ScanbotBarcodeCameraView extends React.Component<Properties, {}> {
170
188
  return newStyle;
171
189
  };
172
190
 
191
+ sanitizeNumbers = (obj: ScanbotBarcodeCameraViewConfiguration) => {
192
+ const outObj = {...obj};
193
+ outObj.cameraZoomFactor = obj.cameraZoomFactor ?? -1;
194
+ outObj.finderAspectRatio = obj.finderAspectRatio ?? { width: -1, height: -1 };
195
+ outObj.finderBackgroundOpacity = obj.finderBackgroundOpacity ?? -1;
196
+ outObj.finderInset = obj.finderInset ?? { left: -1, top: -1, right: -1, bottom: -1};
197
+ outObj.finderLineWidth = obj.finderLineWidth ?? -1;
198
+ outObj.maximumTextLength = obj.maximumTextLength ?? -1;
199
+ outObj.minimumTextLength = obj.minimumTextLength ?? -1;
200
+ outObj.minimum1DBarcodesQuietZone = obj.minimum1DBarcodesQuietZone ?? -1;
201
+ return outObj;
202
+ }
203
+
173
204
  preprocessProps = () => {
174
205
  const props = { ...this.props };
175
206
  delete props.style;
207
+
208
+ const config = props.configuration;
209
+ if (config != null) {
210
+ props.configuration = this.sanitizeNumbers(config as any);
211
+ }
212
+
176
213
  return props;
177
214
  };
178
215
 
@@ -215,12 +252,9 @@ export class ScanbotBarcodeCameraView extends React.Component<Properties, {}> {
215
252
  }
216
253
 
217
254
  sendCommandToViewId = (viewId: number, command: string, args: any = []) => {
218
- let commandId: number
219
- if (Platform.OS == 'android') {
220
- commandId = (UIManager as any).ScanbotBarcodeCameraView.Commands[command].toString();
221
- } else {
222
- commandId = UIManager.getViewManagerConfig('ScanbotBarcodeCameraView').Commands[command];
223
- }
224
- UIManager.dispatchViewManagerCommand(viewId, commandId, args);
255
+ const cameraView = this.cameraViewReference?.current;
256
+ if (cameraView) {
257
+ Commands[command](cameraView);
258
+ }
225
259
  }
226
260
  }
@@ -1,6 +1,8 @@
1
- import { requireNativeComponent } from 'react-native';
2
- import { ScanbotBarcodeCameraViewProperties } from './scanbot-barcode-camera-view-types';
1
+ import { HostComponent } from "react-native";
2
+ import { ScanbotBarcodeCameraNativeViewProperties } from "./scanbot-barcode-camera-view-types";
3
3
 
4
- export default requireNativeComponent<ScanbotBarcodeCameraViewProperties>(
5
- 'ScanbotBarcodeCameraView',
6
- );
4
+ const nativeBarcodeCameraView = require('../../../js/RTNScanbotBarcodeCameraViewNativeComponent').default;
5
+ const nativeBarcodeCameraViewCommands = require('../../../js/RTNScanbotBarcodeCameraViewNativeComponent').Commands;
6
+
7
+ export default (nativeBarcodeCameraView as HostComponent<ScanbotBarcodeCameraNativeViewProperties>);
8
+ export const Commands = nativeBarcodeCameraViewCommands;
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  Scanbot Barcode Scanner SDK React Native Plugin
3
- Copyright (c) 2020 doo GmbH. All rights reserved.
3
+ Copyright (c) 2023 Scanbot SDK GmbH. All rights reserved.
4
4
  https://scanbot.io/sdk
5
5
  */
6
6
  import { FinderAspectRatio, SelectionOverlayConfiguration } from "./model";
@@ -32,6 +32,9 @@ export interface BarcodeScannerConfiguration extends InternalBarcodeDetectionCom
32
32
  /**
33
33
  * Specifies the way a barcode image is generated or disables this generation altogether.
34
34
  * Use if you want to receive a full sized image with barcodes. Defaults to NONE.
35
+ *
36
+ * Note: This property has no effect if overlayConfiguration.overlayEnabled is set to `true`
37
+ * With the tracking overlay enabled, barcode images cannot be generated.
35
38
  */
36
39
  barcodeImageGenerationType?: BarcodeImageGenerationType;
37
40
  /**
package/src/enum.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  Scanbot Barcode Scanner SDK React Native Plugin
3
- Copyright (c) 2020 doo GmbH. All rights reserved.
3
+ Copyright (c) 2023 Scanbot SDK GmbH. All rights reserved.
4
4
  https://scanbot.io/sdk
5
5
  */
6
6
 
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,2 +0,0 @@
1
- #Thu Apr 20 12:17:41 CEST 2023
2
- gradle.version=7.1.1
File without changes
File without changes
@@ -1,18 +0,0 @@
1
- /**
2
- * Automatically generated file. DO NOT MODIFY
3
- */
4
- package io.scanbot.barcodesdk.plugin.reactnative;
5
-
6
- public final class BuildConfig {
7
- public static final boolean DEBUG = Boolean.parseBoolean("true");
8
- public static final String LIBRARY_PACKAGE_NAME = "io.scanbot.barcodesdk.plugin.reactnative";
9
- /**
10
- * @deprecated APPLICATION_ID is misleading in libraries. For the library package name use LIBRARY_PACKAGE_NAME
11
- */
12
- @Deprecated
13
- public static final String APPLICATION_ID = "io.scanbot.barcodesdk.plugin.reactnative";
14
- public static final String BUILD_TYPE = "debug";
15
- public static final String FLAVOR = "";
16
- public static final int VERSION_CODE = 1;
17
- public static final String VERSION_NAME = "1.0";
18
- }
@@ -1,11 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
- package="io.scanbot.barcodesdk.plugin.reactnative"
4
- android:versionCode="1"
5
- android:versionName="1.0" >
6
-
7
- <uses-sdk
8
- android:minSdkVersion="21"
9
- android:targetSdkVersion="29" />
10
-
11
- </manifest>
@@ -1 +0,0 @@
1
- [{"outputType":{"type":"AAPT_FRIENDLY_MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0","enabled":true,"outputFile":"react-native-scanbot-barcode-scanner-sdk-debug.aar","fullName":"debug","baseName":"debug"},"path":"AndroidManifest.xml","properties":{"packageId":"io.scanbot.barcodesdk.plugin.reactnative","split":""}}]
@@ -1,2 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/mayankpatil/Mayank/Projects/SBReactNative/scanbot-barcode-sdk-react-native/android/src/main/jniLibs"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/mayankpatil/Mayank/Projects/SBReactNative/scanbot-barcode-sdk-react-native/android/src/debug/jniLibs"/></dataSet></merger>
@@ -1,2 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/mayankpatil/Mayank/Projects/SBReactNative/scanbot-barcode-sdk-react-native/android/src/main/shaders"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/mayankpatil/Mayank/Projects/SBReactNative/scanbot-barcode-sdk-react-native/android/src/debug/shaders"/></dataSet></merger>
@@ -1,2 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/mayankpatil/Mayank/Projects/SBReactNative/scanbot-barcode-sdk-react-native/android/src/main/assets"/><source path="/Users/mayankpatil/Mayank/Projects/SBReactNative/scanbot-barcode-sdk-react-native/android/build/intermediates/shader_assets/debug/compileDebugShaders/out"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/mayankpatil/Mayank/Projects/SBReactNative/scanbot-barcode-sdk-react-native/android/src/debug/assets"/></dataSet></merger>
@@ -1,4 +0,0 @@
1
- #Wed Aug 03 10:18:34 CEST 2022
2
- /Users/mayankpatil/Mayank/Projects/SBReactNative/scanbot-barcode-sdk-react-native/android/src/main/res/layout/component_barcode_camera_view.xml=/Users/mayankpatil/Mayank/Projects/SBReactNative/scanbot-barcode-sdk-react-native/android/build/intermediates/packaged_res/debug/layout/component_barcode_camera_view.xml
3
- /Users/mayankpatil/Mayank/Projects/SBReactNative/scanbot-barcode-sdk-react-native/android/src/main/res/drawable/ic_baseline_arrow_back_24.xml=/Users/mayankpatil/Mayank/Projects/SBReactNative/scanbot-barcode-sdk-react-native/android/build/intermediates/packaged_res/debug/drawable/ic_baseline_arrow_back_24.xml
4
- /Users/mayankpatil/Mayank/Projects/SBReactNative/scanbot-barcode-sdk-react-native/android/src/main/res/layout/fragment_barcode_scanner.xml=/Users/mayankpatil/Mayank/Projects/SBReactNative/scanbot-barcode-sdk-react-native/android/build/intermediates/packaged_res/debug/layout/fragment_barcode_scanner.xml