react-native-scanbot-barcode-scanner-sdk 3.2.1 → 3.3.0-beta1
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/README.md +2 -1
- package/RNScanbotBarcodeSDK.podspec +1 -1
- package/android/.gradle/6.2/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/build/.transforms/8cdb68f56773f65afa4976aa86d988f7/classes/classes.dex +0 -0
- package/android/build/.transforms/8cdb68f56773f65afa4976aa86d988f7.bin +1 -0
- package/android/build/.transforms/991094845a707011dcf91007d9838bb7/classes/classes.dex +0 -0
- package/android/build/.transforms/991094845a707011dcf91007d9838bb7.bin +1 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +1 -1
- package/android/build/intermediates/compile_library_classes/debug/classes.jar +0 -0
- package/android/build/intermediates/compile_only_not_namespaced_r_class_jar/debug/R.jar +0 -0
- package/android/build/intermediates/incremental/debug-mergeNativeLibs/merge-state +0 -0
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
- package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +4 -3
- package/android/build/intermediates/incremental/packageDebugResources/merger.xml +1 -1
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/JSONUtils$WritableMapBuilder.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/JSONUtils.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ObjectMapper.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ReactBarcodeExtensionsFilter$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ReactBarcodeExtensionsFilter$Type.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ReactBarcodeExtensionsFilter.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule$2.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule$3.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/StorageUtils.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/barcode/ScanbotBarcodeDetectorAdditionalConfigBuilder.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/barcode/ScanbotBarcodeDetectorConfigBuilder.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/EventEmitter.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewFragment$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewFragment$2.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewFragment.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewManager.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/common/ScanbotComponentFrameLayout.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/common/ScanbotComponentRootView.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/filters/ReactBarcodeExtensionsFilter$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/filters/ReactBarcodeExtensionsFilter$Type.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/filters/ReactBarcodeExtensionsFilter.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/utils/BitmapHelper.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/utils/JSONUtils$WritableMapBuilder.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/utils/JSONUtils.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/utils/LogUtils.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/utils/ResponseUtils.class +0 -0
- package/android/build/intermediates/library_java_res/debug/res.jar +0 -0
- package/android/build/intermediates/library_manifest/debug/AndroidManifest.xml +1 -1
- package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLibraryResources/R-def.txt +1 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +3 -3
- package/android/build/intermediates/packaged_res/debug/drawable/ic_baseline_arrow_back_24.xml +10 -0
- package/android/build/intermediates/res/symbol-table-with-package/debug/package-aware-r.txt +5 -43
- package/android/build/intermediates/runtime_library_classes/debug/classes.jar +0 -0
- package/android/build/intermediates/symbols/debug/R.txt +869 -907
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +28 -28
- package/android/build.gradle +1 -1
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ReactBarcodeExtensionsFilter.java +2 -2
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule.java +11 -2
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/RNScanbotBarcodeCameraComponent.java +10 -4
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/RNScanbotBarcodeCameraConfiguration.java +48 -20
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/filters/ReactBarcodeExtensionsFilter.java +1 -1
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/JSONUtils.java +75 -8
- package/ios/.DS_Store +0 -0
- package/ios/Components/BarcodeCameraView/RNScanbotBarcodeCameraView.h +3 -4
- package/ios/Components/BarcodeCameraView/RNScanbotBarcodeCameraView.m +57 -29
- package/ios/ScanbotBarcodeSdk.m +50 -52
- package/ios/ScanbotBarcodeSdk.xcodeproj/xcuserdata/mayankpatil.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/ios/ScanbotBarcodeSdk.xcworkspace/xcuserdata/mayankpatil.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Utils/BarcodeMapping.h +70 -9
- package/ios/Utils/ObjectMapper.h +2 -2
- package/ios/Utils/ObjectMapper.m +22 -22
- package/package.json +1 -1
- package/src/components/barcode-camera-view/scanbot-barcode-camera-view-types.tsx +65 -57
- package/src/configuration.ts +102 -258
- package/src/enum.ts +10 -8
- package/src/model.ts +40 -1
- package/android/.gradle/6.1.1/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/6.1.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/6.1.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/6.1.1/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/6.1.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/6.1.1/gc.properties +0 -0
- package/android/.gradle/7.0-rc-1/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.0-rc-1/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.0-rc-1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.0-rc-1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.0-rc-1/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/configuration-cache/gc.properties +0 -0
- package/android/.idea/caches/build_file_checksums.ser +0 -0
- package/android/.idea/compiler.xml +0 -6
- package/android/.idea/gradle.xml +0 -22
- package/android/.idea/jarRepositories.xml +0 -50
- package/android/.idea/libraries/Gradle__androidx_activity_activity_1_2_3_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_annotation_annotation_1_2_0.xml +0 -11
- package/android/.idea/libraries/Gradle__androidx_annotation_annotation_experimental_1_1_0_rc01_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_appcompat_appcompat_1_3_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_appcompat_appcompat_resources_1_3_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_arch_core_core_common_2_1_0.xml +0 -11
- package/android/.idea/libraries/Gradle__androidx_arch_core_core_runtime_2_1_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_asynclayoutinflater_asynclayoutinflater_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_camera_camera_camera2_1_0_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_camera_camera_core_1_0_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_camera_camera_lifecycle_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_camera_camera_view_1_0_0_alpha24_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_cardview_cardview_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_collection_collection_1_1_0.xml +0 -11
- package/android/.idea/libraries/Gradle__androidx_constraintlayout_constraintlayout_2_0_4_aar.xml +0 -11
- package/android/.idea/libraries/Gradle__androidx_constraintlayout_constraintlayout_solver_2_0_4.xml +0 -9
- package/android/.idea/libraries/Gradle__androidx_coordinatorlayout_coordinatorlayout_1_1_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_core_core_1_5_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_core_core_ktx_1_3_2_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_cursoradapter_cursoradapter_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_customview_customview_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_databinding_viewbinding_4_2_1_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_documentfile_documentfile_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_drawerlayout_drawerlayout_1_0_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_dynamicanimation_dynamicanimation_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_fragment_fragment_1_3_4_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_interpolator_interpolator_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_ui_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_utils_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_legacy_legacy_support_v4_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_common_2_3_1.xml +0 -11
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_2_1_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_core_2_3_1_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_runtime_2_3_1_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_runtime_ktx_2_3_1_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_viewmodel_2_3_1_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_viewmodel_savedstate_2_3_1_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_loader_loader_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_localbroadcastmanager_localbroadcastmanager_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_media_media_1_0_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_print_print_1_0_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_recyclerview_recyclerview_1_1_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_savedstate_savedstate_1_1_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_slidingpanelayout_slidingpanelayout_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_swiperefreshlayout_swiperefreshlayout_1_0_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_transition_transition_1_2_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_1_1_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_animated_1_1_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_versionedparcelable_versionedparcelable_1_1_1_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_viewpager2_viewpager2_1_0_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_viewpager_viewpager_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__com_commonsware_cwac_camera_camera_0_6_41_aar.xml +0 -11
- package/android/.idea/libraries/Gradle__com_facebook_fresco_drawee_2_0_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_fbcore_2_0_0_aar.xml +0 -18
- package/android/.idea/libraries/Gradle__com_facebook_fresco_fresco_2_0_0_aar.xml +0 -18
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_2_0_0_aar.xml +0 -18
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_base_2_0_0_aar.xml +0 -18
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_okhttp3_2_0_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_nativeimagefilters_2_0_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_nativeimagetranscoder_2_0_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_infer_annotation_infer_annotation_0_11_2.xml +0 -13
- package/android/.idea/libraries/Gradle__com_facebook_react_react_native_0_60_6_aar.xml +0 -18
- package/android/.idea/libraries/Gradle__com_facebook_soloader_soloader_0_6_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__com_google_android_material_material_1_3_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_3_0_2.xml +0 -13
- package/android/.idea/libraries/Gradle__com_google_code_gson_gson_2_8_6.xml +0 -13
- package/android/.idea/libraries/Gradle__com_google_dagger_dagger_2_35.xml +0 -13
- package/android/.idea/libraries/Gradle__com_google_guava_listenablefuture_1_0.xml +0 -13
- package/android/.idea/libraries/Gradle__com_squareup_okhttp3_okhttp_3_12_1.xml +0 -13
- package/android/.idea/libraries/Gradle__com_squareup_okhttp3_okhttp_urlconnection_3_12_1.xml +0 -13
- package/android/.idea/libraries/Gradle__com_squareup_okio_okio_1_15_0.xml +0 -13
- package/android/.idea/libraries/Gradle__commons_io_commons_io_2_4.xml +0 -13
- package/android/.idea/libraries/Gradle__io_reactivex_rxjava2_rxandroid_2_0_1_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__io_reactivex_rxjava2_rxjava_2_1_5.xml +0 -13
- package/android/.idea/libraries/Gradle__io_scanbot_scanbot_barcode_scanner_sdk_3_0_1_aar.xml +0 -11
- package/android/.idea/libraries/Gradle__io_scanbot_scanbot_barcode_scanner_sdk_ui_3_0_1_aar.xml +0 -11
- package/android/.idea/libraries/Gradle__io_scanbot_scanbot_sdk_barcode_3_0_1_aar.xml +0 -11
- package/android/.idea/libraries/Gradle__io_scanbot_scanbot_sdk_base_3_0_1_aar.xml +0 -11
- package/android/.idea/libraries/Gradle__io_scanbot_scanbot_sdk_ui_barcode_3_0_1_aar.xml +0 -11
- package/android/.idea/libraries/Gradle__io_scanbot_scanbot_sdk_ui_base_3_0_1_aar.xml +0 -11
- package/android/.idea/libraries/Gradle__io_scanbot_sdk_barcode_assets_3_0_1_aar.xml +0 -11
- package/android/.idea/libraries/Gradle__io_scanbot_sdk_core_barcode_3_0_1_aar.xml +0 -11
- package/android/.idea/libraries/Gradle__io_scanbot_sdk_core_barcode_native_3_0_1_aar.xml +0 -11
- package/android/.idea/libraries/Gradle__io_scanbot_sdk_core_sap_3_0_1_aar.xml +0 -11
- package/android/.idea/libraries/Gradle__javax_inject_javax_inject_1.xml +0 -13
- package/android/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml +0 -13
- package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_4_20.xml +0 -13
- package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_common_1_4_20.xml +0 -13
- package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_jdk7_1_4_20.xml +0 -13
- package/android/.idea/libraries/Gradle__org_jetbrains_kotlinx_kotlinx_coroutines_android_1_4_1.xml +0 -13
- package/android/.idea/libraries/Gradle__org_jetbrains_kotlinx_kotlinx_coroutines_core_jvm_1_4_1.xml +0 -13
- package/android/.idea/libraries/Gradle__org_reactivestreams_reactive_streams_1_0_1.xml +0 -13
- package/android/.idea/misc.xml +0 -9
- package/android/.idea/modules/android.iml +0 -133
- package/android/.idea/modules.xml +0 -8
- package/android/.idea/vcs.xml +0 -6
- package/android/.idea/workspace.xml +0 -62
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule$2$1$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule$2$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule$4.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewFragment$3$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewFragment$3.class +0 -0
package/ios/ScanbotBarcodeSdk.m
CHANGED
|
@@ -48,7 +48,7 @@ RCT_EXPORT_METHOD(initializeSdk:(NSDictionary *)configuration
|
|
|
48
48
|
@"LEGACY": @(SBSDKBarcodeEngineModeLegacy),
|
|
49
49
|
@"NEXT_GEN": @(SBSDKBarcodeEngineModeNextGen)
|
|
50
50
|
},
|
|
51
|
-
@"
|
|
51
|
+
@"allowedInterfaceOrientation": @{
|
|
52
52
|
@"NONE": @(UIInterfaceOrientationMaskAll),
|
|
53
53
|
@"PORTRAIT": @(UIInterfaceOrientationMaskPortrait),
|
|
54
54
|
@"PORTRAIT_UPSIDE_DOWN": @(UIInterfaceOrientationMaskPortraitUpsideDown),
|
|
@@ -83,8 +83,10 @@ RCT_EXPORT_METHOD(initializeSdk:(NSDictionary *)configuration
|
|
|
83
83
|
|
|
84
84
|
if (config.storageBaseDirectory) {
|
|
85
85
|
SBSDKLog(@"Using custom storage base directory: %@", config.storageBaseDirectory);
|
|
86
|
-
NSURL*
|
|
87
|
-
[
|
|
86
|
+
NSURL *customUrl = [[NSURL alloc] initWithString: config.storageBaseDirectory];
|
|
87
|
+
SBSDKStorageLocation *storageLocation = [[SBSDKStorageLocation alloc] initWithBaseURL: customUrl];
|
|
88
|
+
SBSDKUIBarcodeImageStorage *barcodeImageStorageLocation = [[SBSDKUIBarcodeImageStorage alloc] initWithJPEGFileFormatAndCompressionQuality: SBSDKImageFileFormatJPEG location: storageLocation];
|
|
89
|
+
[SBSDKUIBarcodeImageStorage setDefaultStorage:barcodeImageStorageLocation];
|
|
88
90
|
}
|
|
89
91
|
|
|
90
92
|
[ScanbotSDK setSharedApplication:[UIApplication sharedApplication]];
|
|
@@ -120,11 +122,13 @@ RCT_EXPORT_METHOD(startBarcodeScanner:(NSDictionary*)configuration
|
|
|
120
122
|
SBSDKUIBarcodeScannerUIConfiguration* uiConfig = [[SBSDKUIBarcodeScannerUIConfiguration alloc] init];
|
|
121
123
|
SBSDKUIBarcodeScannerBehaviorConfiguration* behaviorConfig = [[SBSDKUIBarcodeScannerBehaviorConfiguration alloc] init];
|
|
122
124
|
SBSDKUIBarcodeScannerTextConfiguration* textConfig = [[SBSDKUIBarcodeScannerTextConfiguration alloc] init];
|
|
123
|
-
|
|
125
|
+
SBSDKUICameraConfiguration* cameraConfig = [[SBSDKUICameraConfiguration alloc] init];
|
|
126
|
+
SBSDKUIBarcodeSelectionOverlayConfiguration* selectionOverlayConfig = nil;
|
|
124
127
|
@try {
|
|
125
128
|
[ObjectMapper populateInstance:uiConfig fromDictionary:configuration];
|
|
126
129
|
[ObjectMapper populateInstance:behaviorConfig fromDictionary:configuration];
|
|
127
130
|
[ObjectMapper populateInstance:textConfig fromDictionary:configuration];
|
|
131
|
+
selectionOverlayConfig = extractSelectionOverlayConfig(configuration);
|
|
128
132
|
}
|
|
129
133
|
@catch (NSException* ex) {
|
|
130
134
|
reject(@"Property error", [ex reason], nil);
|
|
@@ -138,29 +142,28 @@ RCT_EXPORT_METHOD(startBarcodeScanner:(NSDictionary*)configuration
|
|
|
138
142
|
}
|
|
139
143
|
|
|
140
144
|
behaviorConfig.additionalParameters = extractAdditionalParameters(configuration);
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
behaviorConfig.acceptedDocumentTypes = extractBarcodeDocumentTypesFromConfiguration(configuration);
|
|
146
|
+
behaviorConfig.acceptedMachineCodeTypes = extractBarcodeTypesFromConfiguration(configuration);
|
|
147
|
+
behaviorConfig.engineMode = extractEngineMode(configuration);
|
|
148
|
+
|
|
149
|
+
uiConfig.orientationLockMode = [ObjectMapper extractOrientationLockMode:configuration];
|
|
150
|
+
|
|
151
|
+
SBSDKUIBarcodeScannerConfiguration* barcodeScannerConfiguration = [[SBSDKUIBarcodeScannerConfiguration alloc] initWithUIConfiguration:uiConfig
|
|
152
|
+
textConfiguration:textConfig
|
|
153
|
+
behaviorConfiguration:behaviorConfig
|
|
154
|
+
cameraConfiguration:cameraConfig
|
|
155
|
+
selectionOverlayConfiguration: selectionOverlayConfig];
|
|
146
156
|
|
|
147
157
|
SBSDKUICameraConfiguration* cameraConfiguration = extractCameraConfiguration(configuration);
|
|
148
158
|
if (cameraConfiguration) {
|
|
149
|
-
|
|
159
|
+
barcodeScannerConfiguration.cameraConfiguration.camera = cameraConfiguration.camera;
|
|
150
160
|
}
|
|
151
161
|
|
|
152
162
|
bool shouldWaitForGeneratedImage = behaviorConfig.barcodeImageGenerationType != SBSDKBarcodeImageGenerationTypeNone;
|
|
153
163
|
BarcodeScannerPromiseProxy* delegate = [[BarcodeScannerPromiseProxy alloc] initWithResolver: resolve
|
|
154
164
|
shouldWaitForGeneratedImage: shouldWaitForGeneratedImage];
|
|
155
165
|
|
|
156
|
-
SBSDKUIBarcodeScannerViewController* viewController =
|
|
157
|
-
|
|
158
|
-
if (acceptedDocumentTypes && acceptedDocumentTypes.count > 0) {
|
|
159
|
-
viewController = [SBSDKUIBarcodeScannerViewController createNewWithAcceptedMachineCodeTypes:machineCodeTypes withAcceptedDocumentTypes:acceptedDocumentTypes configuration:config andDelegate:delegate];
|
|
160
|
-
} else {
|
|
161
|
-
viewController = [SBSDKUIBarcodeScannerViewController createNewWithAcceptedMachineCodeTypes:machineCodeTypes configuration:config andDelegate:delegate];
|
|
162
|
-
}
|
|
163
|
-
|
|
166
|
+
SBSDKUIBarcodeScannerViewController* viewController = [SBSDKUIBarcodeScannerViewController createNewWithConfiguration:barcodeScannerConfiguration andDelegate:delegate];
|
|
164
167
|
[self presentActiveViewController:viewController];
|
|
165
168
|
}
|
|
166
169
|
|
|
@@ -174,14 +177,16 @@ RCT_EXPORT_METHOD(startBatchBarcodeScanner:(NSDictionary*)configuration
|
|
|
174
177
|
withResolver:(RCTPromiseResolveBlock)resolve
|
|
175
178
|
withRejecter:(RCTPromiseRejectBlock)reject) {
|
|
176
179
|
|
|
177
|
-
SBSDKUIBarcodesBatchScannerUIConfiguration *
|
|
178
|
-
SBSDKUIBarcodesBatchScannerTextConfiguration *
|
|
179
|
-
SBSDKUIBarcodesBatchScannerBehaviorConfiguration *
|
|
180
|
-
|
|
180
|
+
SBSDKUIBarcodesBatchScannerUIConfiguration *uiConfig = [[SBSDKUIBarcodesBatchScannerUIConfiguration alloc] init];
|
|
181
|
+
SBSDKUIBarcodesBatchScannerTextConfiguration *textConfig = [[SBSDKUIBarcodesBatchScannerTextConfiguration alloc] init];
|
|
182
|
+
SBSDKUIBarcodesBatchScannerBehaviorConfiguration *behaviorConfig = [[SBSDKUIBarcodesBatchScannerBehaviorConfiguration alloc] init];
|
|
183
|
+
SBSDKUICameraConfiguration* cameraConfig = [[SBSDKUICameraConfiguration alloc] init];
|
|
184
|
+
SBSDKUIBarcodeSelectionOverlayConfiguration* selectionOverlayConfig = nil;
|
|
181
185
|
@try {
|
|
182
|
-
[ObjectMapper populateInstance:
|
|
183
|
-
[ObjectMapper populateInstance:
|
|
184
|
-
[ObjectMapper populateInstance:
|
|
186
|
+
[ObjectMapper populateInstance:uiConfig fromDictionary:configuration];
|
|
187
|
+
[ObjectMapper populateInstance:behaviorConfig fromDictionary:configuration];
|
|
188
|
+
[ObjectMapper populateInstance:textConfig fromDictionary:configuration];
|
|
189
|
+
selectionOverlayConfig = extractSelectionOverlayConfig(configuration);
|
|
185
190
|
}
|
|
186
191
|
@catch (NSException* ex) {
|
|
187
192
|
reject(@"Property error", [ex reason], nil);
|
|
@@ -191,39 +196,33 @@ RCT_EXPORT_METHOD(startBatchBarcodeScanner:(NSDictionary*)configuration
|
|
|
191
196
|
// Barcode Filter (at the moment used for UPC Extension filters)
|
|
192
197
|
SBSDKUIBarcodeFilter* barcodeFilter = extractBarcodeFilter(configuration);
|
|
193
198
|
if (barcodeFilter != nil) {
|
|
194
|
-
|
|
199
|
+
behaviorConfig.barcodeFilter = barcodeFilter;
|
|
195
200
|
}
|
|
196
201
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
202
|
+
behaviorConfig.additionalDetectionParameters = extractAdditionalParameters(configuration);
|
|
203
|
+
behaviorConfig.acceptedDocumentTypes = extractBarcodeDocumentTypesFromConfiguration(configuration);;
|
|
204
|
+
behaviorConfig.acceptedMachineCodeTypes = extractBarcodeTypesFromConfiguration(configuration);
|
|
205
|
+
behaviorConfig.engineMode = extractEngineMode(configuration);
|
|
206
|
+
|
|
207
|
+
uiConfig.orientationLockMode = [ObjectMapper extractOrientationLockMode:configuration];
|
|
208
|
+
|
|
209
|
+
SBSDKUIBarcodesBatchScannerConfiguration *batchBarcodeConfig = [[SBSDKUIBarcodesBatchScannerConfiguration alloc]
|
|
210
|
+
initWithUIConfiguration:uiConfig
|
|
211
|
+
textConfiguration:textConfig
|
|
212
|
+
behaviorConfiguration:behaviorConfig
|
|
213
|
+
cameraConfiguration:cameraConfig
|
|
214
|
+
selectionOverlayConfiguration:selectionOverlayConfig];
|
|
215
|
+
|
|
207
216
|
SBSDKUICameraConfiguration* cameraConfiguration = extractCameraConfiguration(configuration);
|
|
208
217
|
if (cameraConfiguration) {
|
|
209
|
-
|
|
218
|
+
batchBarcodeConfig.cameraConfiguration.camera = cameraConfiguration.camera;
|
|
210
219
|
}
|
|
211
220
|
|
|
212
221
|
BatchBarcodeScannerPromiseProxy* delegate = [[BatchBarcodeScannerPromiseProxy alloc] initWithResolver:resolve];
|
|
213
222
|
|
|
214
|
-
SBSDKUIBarcodesBatchScannerViewController* viewController =
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
viewController = [SBSDKUIBarcodesBatchScannerViewController createNewWithAcceptedMachineCodeTypes:machineCodeTypes
|
|
218
|
-
withAcceptedDocumentTypes:acceptedDocumentTypes
|
|
219
|
-
configuration:config
|
|
220
|
-
andDelegate:delegate];
|
|
221
|
-
} else {
|
|
222
|
-
viewController = [SBSDKUIBarcodesBatchScannerViewController createNewWithAcceptedMachineCodeTypes:machineCodeTypes
|
|
223
|
-
configuration:config
|
|
224
|
-
andDelegate:delegate];
|
|
225
|
-
}
|
|
226
|
-
|
|
223
|
+
SBSDKUIBarcodesBatchScannerViewController* viewController = [SBSDKUIBarcodesBatchScannerViewController
|
|
224
|
+
createNewWithConfiguration:batchBarcodeConfig
|
|
225
|
+
andDelegate:delegate];
|
|
227
226
|
[self presentActiveViewController:viewController];
|
|
228
227
|
}
|
|
229
228
|
|
|
@@ -293,8 +292,7 @@ RCT_EXPORT_METHOD(cleanup:(RCTPromiseResolveBlock)resolve
|
|
|
293
292
|
runInBackground(^{
|
|
294
293
|
|
|
295
294
|
SBSDKLog(@"Cleaning SBSDKUIBarcodeImageStorage ...");
|
|
296
|
-
[SBSDKUIBarcodeImageStorage
|
|
297
|
-
|
|
295
|
+
[[SBSDKUIBarcodeImageStorage defaultStorage] removeAll];
|
|
298
296
|
SBSDKLog(@"Cleaning the plugin storage directory ...");
|
|
299
297
|
NSError *cleanupError = [ScanbotStorageUtils removeAllFilesFromPluginStorageDirectory];
|
|
300
298
|
if (!cleanupError) {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>SchemeUserState</key>
|
|
6
|
+
<dict>
|
|
7
|
+
<key>ScanbotBarcodeSdk.xcscheme_^#shared#^_</key>
|
|
8
|
+
<dict>
|
|
9
|
+
<key>orderHint</key>
|
|
10
|
+
<integer>0</integer>
|
|
11
|
+
</dict>
|
|
12
|
+
</dict>
|
|
13
|
+
</dict>
|
|
14
|
+
</plist>
|
|
Binary file
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
//
|
|
7
7
|
#ifndef BarcodeMapping_h
|
|
8
8
|
#define BarcodeMapping_h
|
|
9
|
-
|
|
9
|
+
#import "UIColor+JSON.h"
|
|
10
10
|
#include "ScanbotStorageUtils.h"
|
|
11
11
|
#include "ReactBarcodeExtensionsFilter.h"
|
|
12
12
|
@import ScanbotBarcodeScannerSDK;
|
|
@@ -63,7 +63,7 @@ static inline NSString* stringFromBarcodeType(SBSDKBarcodeType* type) {
|
|
|
63
63
|
if ([type.name isEqualToString:@"RSSExpanded"]) {
|
|
64
64
|
return @"RSS_EXPANDED";
|
|
65
65
|
}
|
|
66
|
-
|
|
66
|
+
|
|
67
67
|
NSString* result = [type.name uppercaseString];
|
|
68
68
|
result = [result stringByReplacingOccurrencesOfString:@"-" withString:@"_"];
|
|
69
69
|
result = [result stringByReplacingOccurrencesOfString:@" " withString:@"_"];
|
|
@@ -85,7 +85,7 @@ static inline NSArray<NSDictionary<NSString*, NSObject*>*>* jsonFromBarcodeResul
|
|
|
85
85
|
for (int i = 0; i < results.count; ++i) {
|
|
86
86
|
[jsonResults addObject:jsonFromBarcodeResult([results objectAtIndex:i])];
|
|
87
87
|
}
|
|
88
|
-
|
|
88
|
+
|
|
89
89
|
return [jsonResults copy];
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -94,13 +94,13 @@ static inline NSArray<NSDictionary<NSString*, NSObject*>*>* jsonFromMappedBarcod
|
|
|
94
94
|
for (int i = 0; i < results.count; ++i) {
|
|
95
95
|
[jsonResults addObject:jsonFromBarcodeResult([results objectAtIndex:i].barcode)];
|
|
96
96
|
}
|
|
97
|
-
|
|
97
|
+
|
|
98
98
|
return [jsonResults copy];
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
static inline SBSDKBarcodeMSIPlesseyChecksumAlgorithm extractPlesseyChecksumAlgorithmFromConfiguration(NSDictionary* configuration) {
|
|
102
102
|
NSString* algorithm = [configuration objectForKey:@"msiPlesseyChecksumAlgorithm"];
|
|
103
|
-
|
|
103
|
+
|
|
104
104
|
if (algorithm != nil) {
|
|
105
105
|
if ([algorithm isEqualToString:@"None"]) return SBSDKBarcodeMSIPlesseyChecksumAlgorithmNone;
|
|
106
106
|
if ([algorithm isEqualToString:@"Mod10"]) return SBSDKBarcodeMSIPlesseyChecksumAlgorithmMod10;
|
|
@@ -110,7 +110,7 @@ static inline SBSDKBarcodeMSIPlesseyChecksumAlgorithm extractPlesseyChecksumAlgo
|
|
|
110
110
|
if ([algorithm isEqualToString:@"Mod1110IBM"]) return SBSDKBarcodeMSIPlesseyChecksumAlgorithmMod1110IBM;
|
|
111
111
|
if ([algorithm isEqualToString:@"Mod1110NCR"]) return SBSDKBarcodeMSIPlesseyChecksumAlgorithmMod1110NCR;
|
|
112
112
|
}
|
|
113
|
-
|
|
113
|
+
|
|
114
114
|
return SBSDKBarcodeMSIPlesseyChecksumAlgorithmMod10;
|
|
115
115
|
}
|
|
116
116
|
|
|
@@ -133,18 +133,18 @@ static inline SBSDKUIBarcodeFilter* extractBarcodeFilter(NSDictionary* configura
|
|
|
133
133
|
|
|
134
134
|
static inline NSArray* filterBarcodeResults(NSArray<SBSDKBarcodeScannerResult *>* barcodeResults, SBSDKUIBarcodeFilter* filter) {
|
|
135
135
|
NSMutableArray<SBSDKBarcodeScannerResult *>* outResults = [[NSMutableArray alloc] init];
|
|
136
|
-
|
|
136
|
+
|
|
137
137
|
if (barcodeResults == nil) {
|
|
138
138
|
return outResults;
|
|
139
139
|
}
|
|
140
|
-
|
|
140
|
+
|
|
141
141
|
for (SBSDKBarcodeScannerResult* result in barcodeResults) {
|
|
142
142
|
if (![filter acceptsBarcode:result]) {
|
|
143
143
|
continue;
|
|
144
144
|
}
|
|
145
145
|
[outResults addObject:result];
|
|
146
146
|
}
|
|
147
|
-
|
|
147
|
+
|
|
148
148
|
return outResults;
|
|
149
149
|
}
|
|
150
150
|
|
|
@@ -178,6 +178,19 @@ static inline NSArray* extractBarcodeDocumentTypesFromConfiguration(NSDictionary
|
|
|
178
178
|
return nil;
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
+
static inline SBSDKBarcodeDensity extractBarcodeDensity(NSDictionary* configuration) {
|
|
182
|
+
SBSDKBarcodeDensity barcodeDensity = SBSDKBarcodeDensityLow;
|
|
183
|
+
|
|
184
|
+
NSString* codeDensity = [configuration objectForKey:@"codeDensity"];
|
|
185
|
+
if (codeDensity != nil) {
|
|
186
|
+
if([codeDensity isEqualToString:@"HIGH"]) {
|
|
187
|
+
barcodeDensity = SBSDKBarcodeDensityHigh;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return barcodeDensity;
|
|
192
|
+
}
|
|
193
|
+
|
|
181
194
|
static inline SBSDKBarcodeEngineMode extractEngineMode(NSDictionary* configuration) {
|
|
182
195
|
NSString* mode = [configuration objectForKey:@"engineMode"];
|
|
183
196
|
|
|
@@ -207,6 +220,8 @@ static inline SBSDKBarcodeAdditionalParameters* extractAdditionalParameters(NSDi
|
|
|
207
220
|
// We also need to manually extract the MSI-Plessey Checksum Algorithm since it can't be mapped automatically
|
|
208
221
|
additionalParameters.msiPlesseyChecksumAlgorithm = extractPlesseyChecksumAlgorithmFromConfiguration(configuration);
|
|
209
222
|
|
|
223
|
+
additionalParameters.codeDensity = extractBarcodeDensity(configuration);
|
|
224
|
+
|
|
210
225
|
return additionalParameters;
|
|
211
226
|
}
|
|
212
227
|
|
|
@@ -227,4 +242,50 @@ static inline SBSDKUICameraConfiguration* extractCameraConfiguration(NSDictionar
|
|
|
227
242
|
return cameraConfiguration;
|
|
228
243
|
}
|
|
229
244
|
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
Extracts the selection overlay configuration values from the JSON dictionary.
|
|
248
|
+
*/
|
|
249
|
+
static inline SBSDKUIBarcodeSelectionOverlayConfiguration* extractSelectionOverlayConfig(NSDictionary *dictionary) {
|
|
250
|
+
SBSDKUIBarcodeSelectionOverlayConfiguration *overlayConfig = [[SBSDKUIBarcodeSelectionOverlayConfiguration alloc] init];
|
|
251
|
+
NSDictionary *selectionOverlayDictionary = [dictionary objectForKey:@"overlayConfiguration"];
|
|
252
|
+
if (selectionOverlayDictionary != nil) {
|
|
253
|
+
NSNumber *overlayEnabled = [selectionOverlayDictionary objectForKey:@"overlayEnabled"];
|
|
254
|
+
if (overlayEnabled != nil) {
|
|
255
|
+
overlayConfig.overlayEnabled = overlayEnabled.boolValue;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
NSString *polygonColor = [selectionOverlayDictionary objectForKey:@"polygonColor"];
|
|
259
|
+
if (polygonColor != nil) {
|
|
260
|
+
overlayConfig.polygonColor = [UIColor colorFromHexString:polygonColor];
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
NSString *textColor = [selectionOverlayDictionary objectForKey:@"textColor"];
|
|
264
|
+
if (textColor != nil) {
|
|
265
|
+
overlayConfig.textColor = [UIColor colorFromHexString:textColor];
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
NSString *textContainerColor = [selectionOverlayDictionary objectForKey:@"textContainerColor"];
|
|
269
|
+
if (textContainerColor != nil) {
|
|
270
|
+
overlayConfig.textContainerColor = [UIColor colorFromHexString:textContainerColor];
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
NSString *highlightedPolygonColor = [selectionOverlayDictionary objectForKey:@"highlightedPolygonColor"];
|
|
274
|
+
if (highlightedPolygonColor != nil) {
|
|
275
|
+
overlayConfig.highlightedPolygonColor = [UIColor colorFromHexString:highlightedPolygonColor];
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
NSString *highlightedTextColor = [selectionOverlayDictionary objectForKey:@"highlightedTextColor"];
|
|
279
|
+
if (highlightedTextColor != nil) {
|
|
280
|
+
overlayConfig.highlightedTextColor = [UIColor colorFromHexString:highlightedTextColor];
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
NSString *highlightedTextContainerColor = [selectionOverlayDictionary objectForKey:@"highlightedTextContainerColor"];
|
|
284
|
+
if (highlightedTextContainerColor != nil) {
|
|
285
|
+
overlayConfig.highlightedTextContainerColor = [UIColor colorFromHexString:highlightedTextContainerColor];
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
return overlayConfig;
|
|
289
|
+
}
|
|
290
|
+
|
|
230
291
|
#endif /* BarcodeMapping_h */
|
package/ios/Utils/ObjectMapper.h
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
#import <Foundation/Foundation.h>
|
|
9
9
|
#import <UIKit/UIKit.h>
|
|
10
|
-
|
|
10
|
+
#import "ScanbotBarcodeSdk.h"
|
|
11
11
|
|
|
12
12
|
@interface ObjectMapper : NSObject
|
|
13
13
|
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
+ (void)populateInstance:(id)instance
|
|
18
18
|
fromDictionary:(NSDictionary*)dictionary;
|
|
19
19
|
|
|
20
|
-
+ (
|
|
20
|
+
+ (SBSDKOrientationLock)extractOrientationLockMode:(NSDictionary*)configuration;
|
|
21
21
|
|
|
22
22
|
+ (NSString *) normalizeJsonString:(NSString *)strValue;
|
|
23
23
|
+ (NSURL *) normalizeJsonFileURL:(NSString *)fileUrl;
|
package/ios/Utils/ObjectMapper.m
CHANGED
|
@@ -19,7 +19,7 @@ static NSDictionary<NSString*, NSDictionary<NSString*, NSNumber*>*>* _enumeratio
|
|
|
19
19
|
NSDictionary *sizeDict = (NSDictionary *)value;
|
|
20
20
|
return @(CGSizeFromJson(sizeDict));
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
|
|
23
23
|
if ([propertyType isEqualToString:@"@\"UIColor\""]) {
|
|
24
24
|
return [UIColor colorFromHexString:value];
|
|
25
25
|
}
|
|
@@ -29,7 +29,6 @@ static NSDictionary<NSString*, NSDictionary<NSString*, NSNumber*>*>* _enumeratio
|
|
|
29
29
|
double height = [[value objectForKey:@"height"] doubleValue];
|
|
30
30
|
return [[SBSDKAspectRatio alloc] initWithWidth:width andHeight:height];
|
|
31
31
|
}
|
|
32
|
-
|
|
33
32
|
return nil;
|
|
34
33
|
}
|
|
35
34
|
|
|
@@ -40,28 +39,32 @@ static NSDictionary<NSString*, NSDictionary<NSString*, NSNumber*>*>* _enumeratio
|
|
|
40
39
|
+ (void)populateInstance:(id)instance fromDictionary:(NSDictionary *)dictionary class:(Class)cls {
|
|
41
40
|
uint outCount;
|
|
42
41
|
objc_property_t* properties = class_copyPropertyList(cls, &outCount);
|
|
43
|
-
|
|
42
|
+
|
|
44
43
|
for (uint pi = 0; pi < outCount; ++pi) {
|
|
45
44
|
const char *name = property_getName(properties[pi]);
|
|
46
45
|
NSString* key = [NSString stringWithUTF8String:name];
|
|
47
|
-
|
|
46
|
+
|
|
47
|
+
if ([key isEqualToString:@"finderInset"]) {
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
|
|
48
51
|
objc_property_attribute_t *propertyType = property_copyAttributeList(properties[pi], NULL);
|
|
49
52
|
NSString *propertyTypeString = [NSString stringWithUTF8String:propertyType->value];
|
|
50
53
|
free(propertyType);
|
|
51
|
-
|
|
54
|
+
|
|
52
55
|
id value = [dictionary objectForKey:key];
|
|
53
|
-
|
|
56
|
+
|
|
54
57
|
// normalize OK and Ok
|
|
55
58
|
if (!value && [key hasSuffix:@"Ok"]) {
|
|
56
59
|
NSString* okKey = [key stringByReplacingOccurrencesOfString:@"Ok" withString:@"OK"];
|
|
57
60
|
value = [dictionary objectForKey:okKey];
|
|
58
61
|
}
|
|
59
|
-
|
|
62
|
+
|
|
60
63
|
// fix flashImageButtonHidden to flashButtonHidden
|
|
61
64
|
if (!value && [key isEqualToString:@"flashImageButtonHidden"]) {
|
|
62
65
|
value = [dictionary objectForKey:@"flashButtonHidden"];
|
|
63
66
|
}
|
|
64
|
-
|
|
67
|
+
|
|
65
68
|
if (value) {
|
|
66
69
|
NSDictionary<NSString*, NSNumber*>* valuesDict = [_enumerationMapping objectForKey:key];
|
|
67
70
|
if (valuesDict) {
|
|
@@ -75,35 +78,32 @@ static NSDictionary<NSString*, NSDictionary<NSString*, NSNumber*>*>* _enumeratio
|
|
|
75
78
|
value = native;
|
|
76
79
|
}
|
|
77
80
|
}
|
|
78
|
-
|
|
81
|
+
|
|
79
82
|
[instance setValue:value forKey:key];
|
|
80
83
|
}
|
|
81
84
|
}
|
|
82
|
-
|
|
85
|
+
|
|
83
86
|
free(properties);
|
|
84
87
|
}
|
|
85
88
|
|
|
86
89
|
+ (void)populateInstance:(id)instance
|
|
87
90
|
fromDictionary:(NSDictionary*)dictionary {
|
|
88
91
|
Class cls = [instance class];
|
|
89
|
-
|
|
92
|
+
|
|
90
93
|
while (cls != nil && cls != NSObject.class) {
|
|
91
94
|
[ObjectMapper populateInstance:instance fromDictionary:dictionary class:cls];
|
|
92
95
|
cls = [cls superclass];
|
|
93
96
|
}
|
|
94
97
|
}
|
|
95
98
|
|
|
96
|
-
+ (
|
|
97
|
-
NSString* orientationLockMode = [configuration objectForKey:@"
|
|
99
|
+
+ (SBSDKOrientationLock)extractOrientationLockMode:(NSDictionary*)configuration {
|
|
100
|
+
NSString* orientationLockMode = [configuration objectForKey:@"allowedInterfaceOrientations"];
|
|
98
101
|
if (orientationLockMode) {
|
|
99
|
-
if ([orientationLockMode isEqualToString:@"
|
|
100
|
-
if ([orientationLockMode isEqualToString:@"PORTRAIT"]) return
|
|
101
|
-
if ([orientationLockMode isEqualToString:@"
|
|
102
|
-
if ([orientationLockMode isEqualToString:@"LANDSCAPE_LEFT"]) return UIInterfaceOrientationMaskLandscapeLeft;
|
|
103
|
-
if ([orientationLockMode isEqualToString:@"LANDSCAPE_RIGHT"]) return UIInterfaceOrientationMaskLandscapeRight;
|
|
104
|
-
if ([orientationLockMode isEqualToString:@"LANDSCAPE"]) return UIInterfaceOrientationMaskLandscape;
|
|
102
|
+
if ([orientationLockMode isEqualToString:@"ALL"]) return SBSDKOrientationLockNone;
|
|
103
|
+
if ([orientationLockMode isEqualToString:@"PORTRAIT"]) return SBSDKOrientationLockPortrait;
|
|
104
|
+
if ([orientationLockMode isEqualToString:@"LANDSCAPE"]) return SBSDKOrientationLockLandscape;
|
|
105
105
|
}
|
|
106
|
-
return
|
|
106
|
+
return SBSDKOrientationLockNone;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
+ (NSString *)normalizeJsonString:(NSString *)strValue {
|
|
@@ -121,13 +121,13 @@ static NSDictionary<NSString*, NSDictionary<NSString*, NSNumber*>*>* _enumeratio
|
|
|
121
121
|
if (!strValue) {
|
|
122
122
|
return nil;
|
|
123
123
|
}
|
|
124
|
-
|
|
124
|
+
|
|
125
125
|
// check if we have a valid file URL
|
|
126
126
|
NSURL* url = [NSURL URLWithString:strValue];
|
|
127
127
|
if (url.isFileURL) {
|
|
128
128
|
return url;
|
|
129
129
|
}
|
|
130
|
-
|
|
130
|
+
|
|
131
131
|
// otherwise convert the path to a file URL ("/some/path" to "file:///some/path")
|
|
132
132
|
return [NSURL fileURLWithPath:strValue];
|
|
133
133
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-scanbot-barcode-scanner-sdk",
|
|
3
3
|
"title": "Scanbot Barcode Scanner SDK for React Native",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.3.0-beta1",
|
|
5
5
|
"description": "Scanbot Barcode Scanner SDK React Native Plugin for Android and iOS",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"files": [
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import { forSlideLeft } from '@react-navigation/stack/lib/typescript/src/TransitionConfigs/HeaderStyleInterpolators';
|
|
1
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
2
3
|
import { BarcodeResult } from 'react-native-scanbot-barcode-scanner-sdk';
|
|
4
|
+
import { BarcodeAdditionalParameters } from 'react-native-scanbot-barcode-scanner-sdk/src/configuration';
|
|
3
5
|
import {
|
|
4
6
|
BarcodeDocumentFormat,
|
|
5
7
|
BarcodeFilter,
|
|
6
8
|
BarcodeFormat,
|
|
7
9
|
EngineMode,
|
|
8
|
-
MSIPlesseyChecksumAlgorithm,
|
|
9
10
|
} from '../../enum';
|
|
10
|
-
import { FinderAspectRatio } from '../../model';
|
|
11
|
+
import { FinderAspectRatio, SelectionOverlayConfiguration } from '../../model';
|
|
11
12
|
|
|
12
13
|
export interface ScanbotBarcodeCameraViewProperties {
|
|
13
14
|
onBarcodeScannerResult?: (result: BarcodeResult) => void;
|
|
@@ -22,13 +23,52 @@ export interface ScanbotBarcodeCameraViewBarcode {
|
|
|
22
23
|
type: string;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
/**
|
|
27
|
+
* This class contians all the configurations needed for Scanbot Barcode Camera View.
|
|
28
|
+
*/
|
|
29
|
+
export interface ScanbotBarcodeCameraViewConfiguration extends FinderConfig, BarcodeAdditionalParameters {
|
|
26
30
|
/**
|
|
27
|
-
*
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
* Whether flash is toggled on or off.
|
|
32
|
+
*/
|
|
33
|
+
flashEnabled?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* List of accepted Barcode Formats; any formats that are not included in this
|
|
36
|
+
* list will not be detected by the `BarcodeCameraView`. By default, the list
|
|
37
|
+
* includes all supported barcode types.
|
|
38
|
+
*/
|
|
39
|
+
barcodeFormats?: BarcodeFormat[];
|
|
40
|
+
/**
|
|
41
|
+
* An optional array of barcode document formats that acts as a detection filter.
|
|
42
|
+
* By default all supported document formats will be detected.
|
|
43
|
+
*/
|
|
44
|
+
acceptedDocumentFormats?: BarcodeDocumentFormat[];
|
|
45
|
+
/**
|
|
46
|
+
* The engine mode of the barcode recognizer. Defaults to NEXT_GEN.
|
|
47
|
+
* To use legacy recognizer, please specify LEGACY
|
|
31
48
|
*/
|
|
49
|
+
engineMode?: EngineMode;
|
|
50
|
+
/**
|
|
51
|
+
* The relative initial zoom level of the camera in the range [0,1], where 0 is zoomed out and 1 is zoomed in.
|
|
52
|
+
* The default value is 0.-
|
|
53
|
+
*/
|
|
54
|
+
cameraZoomFactor?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Use a filter to determine which type of barcode can be detected; see `BarcodeFilter`
|
|
57
|
+
*/
|
|
58
|
+
barcodeFilter?: BarcodeFilter;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* This class contains all the finder configurations.
|
|
63
|
+
*/
|
|
64
|
+
export interface FinderConfig {
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* The finder view is a rectangular overlay view that clips the camera view,
|
|
68
|
+
* so that the detection will focus just a specific area. You can specify
|
|
69
|
+
* the size and positioning, as well as other UI properties.
|
|
70
|
+
* Set this property to `true` if you want to use the Finder View, `false` otherwise (default: false)
|
|
71
|
+
*/
|
|
32
72
|
shouldUseFinderView?: boolean;
|
|
33
73
|
/**
|
|
34
74
|
* The finder view rectangular overlay border width
|
|
@@ -61,63 +101,31 @@ export interface ScanbotBarcodeCameraViewConfiguration {
|
|
|
61
101
|
*/
|
|
62
102
|
finderVerticalOffset?: number;
|
|
63
103
|
/**
|
|
64
|
-
*
|
|
65
|
-
*/
|
|
66
|
-
flashEnabled?: boolean;
|
|
67
|
-
/**
|
|
68
|
-
* List of accepted Barcode Formats; any formats that are not included in this
|
|
69
|
-
* list will not be detected by the `BarcodeCameraView`. By default, the list
|
|
70
|
-
* includes all supported barcode types.
|
|
104
|
+
* Set the finderInsets left, top, bottom, right
|
|
71
105
|
*/
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
* The checksum algorithm for MSI Plessey barcodes.
|
|
81
|
-
* The default value is `Mod10'
|
|
82
|
-
*/
|
|
83
|
-
msiPlesseyChecksumAlgorithm?: MSIPlesseyChecksumAlgorithm;
|
|
84
|
-
/**
|
|
85
|
-
* The engine mode of the barcode recognizer. Defaults to NEXT_GEN.
|
|
86
|
-
* To use legacy recognizer, please specify LEGACY
|
|
87
|
-
*/
|
|
88
|
-
engineMode?: EngineMode;
|
|
89
|
-
/**
|
|
90
|
-
* The relative initial zoom level of the camera in the range [0,1], where 0 is zoomed out and 1 is zoomed in.
|
|
91
|
-
* The default value is 0.
|
|
92
|
-
*/
|
|
93
|
-
cameraZoomFactor?: number;
|
|
106
|
+
finderInset?: FinderInset
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* This class contains properties to Set the finder insets for the finder view.
|
|
111
|
+
*/
|
|
112
|
+
export interface FinderInset {
|
|
113
|
+
|
|
94
114
|
/**
|
|
95
|
-
*
|
|
96
|
-
* Turn it off, if you don't want to see decoded FNC1 characters ("]C1" and ASCII char 29).
|
|
97
|
-
* The default value is `true`.
|
|
98
|
-
* NOTE: Currently works for CODE128 barcodes only.
|
|
115
|
+
* set the left inset
|
|
99
116
|
*/
|
|
100
|
-
|
|
117
|
+
left: number;
|
|
101
118
|
/**
|
|
102
|
-
*
|
|
103
|
-
* The default is 0 (setting is turned off).
|
|
104
|
-
* NOTE: This feature works on ITF barcodes only.
|
|
119
|
+
* set the top inset
|
|
105
120
|
*/
|
|
106
|
-
|
|
121
|
+
top: number;
|
|
107
122
|
/**
|
|
108
|
-
*
|
|
109
|
-
* The default is 0 (setting is turned off).
|
|
110
|
-
* NOTE: This feature works on ITF barcodes only.
|
|
123
|
+
* set the bottom inset
|
|
111
124
|
*/
|
|
112
|
-
|
|
125
|
+
bottom: number;
|
|
113
126
|
/**
|
|
114
|
-
*
|
|
115
|
-
* Has no effect if both single and double digit MSI Plessey checksums are enabled.
|
|
116
|
-
* The default is `false`
|
|
127
|
+
* set the right inset
|
|
117
128
|
*/
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Use a filter to determine which type of barcode can be detected; see `BarcodeFilter`
|
|
121
|
-
*/
|
|
122
|
-
barcodeFilter?: BarcodeFilter;
|
|
129
|
+
right: number;
|
|
123
130
|
}
|
|
131
|
+
|