react-native-scanbot-barcode-scanner-sdk 7.0.0-rc.1 → 7.0.0-rc.3
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 +13 -33
- package/README.md +272 -39
- package/RNScanbotBarcodeSDK.podspec +1 -1
- package/android/gradle.properties +1 -1
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule.kt +1 -1
- 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/ScanbotBarcodeScannerViewManager.kt +5 -0
- package/android/src/paper/com/facebook/react/viewmanagers/ScanbotBarcodeScannerViewManagerDelegate.java +3 -0
- package/android/src/paper/com/facebook/react/viewmanagers/ScanbotBarcodeScannerViewManagerInterface.java +1 -0
- package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerLegacyView.h +1 -0
- package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerLegacyView.m +17 -11
- package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerView.h +1 -0
- package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerView.mm +18 -13
- package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerViewControllerWrapper.h +3 -0
- package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerViewControllerWrapper.m +4 -0
- package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerViewManager.mm +1 -0
- package/ios/ScanbotBarcodeSdkPluginResultDelegate.m +1 -1
- package/lib/commonjs/barcode/BarcodeConfigurationTypes.js +19 -19
- package/lib/commonjs/barcode/BarcodeTypes.js +1 -1
- package/lib/commonjs/component/barcode-camera-view/ScanbotBarcodeCameraView.js +10 -5
- package/lib/commonjs/component/barcode-camera-view/ScanbotBarcodeCameraView.js.map +1 -1
- package/lib/commonjs/component/spec/ScanbotBarcodeScannerViewNativeComponent.js.map +1 -1
- package/lib/commonjs/documents/CommonFieldType.js +1 -1
- package/lib/commonjs/utils/json/JsonSerializationTypes.js +1 -1
- package/lib/module/barcode/BarcodeConfigurationTypes.js +19 -19
- package/lib/module/barcode/BarcodeTypes.js +1 -1
- package/lib/module/component/barcode-camera-view/ScanbotBarcodeCameraView.js +10 -5
- package/lib/module/component/barcode-camera-view/ScanbotBarcodeCameraView.js.map +1 -1
- package/lib/module/component/spec/ScanbotBarcodeScannerViewNativeComponent.js.map +1 -1
- package/lib/module/documents/CommonFieldType.js +1 -1
- package/lib/module/utils/json/JsonSerializationTypes.js +1 -1
- package/lib/typescript/src/barcode/BarcodeConfigurationTypes.d.ts +19 -19
- package/lib/typescript/src/barcode/BarcodeTypes.d.ts +1 -1
- package/lib/typescript/src/component/barcode-camera-view/ScanbotBarcodeCameraView.d.ts.map +1 -1
- package/lib/typescript/src/component/barcode-camera-view/ScanbotBarcodeCameraViewProperties.d.ts +6 -1
- package/lib/typescript/src/component/barcode-camera-view/ScanbotBarcodeCameraViewProperties.d.ts.map +1 -1
- package/lib/typescript/src/component/spec/ScanbotBarcodeScannerViewNativeComponent.d.ts +1 -0
- package/lib/typescript/src/component/spec/ScanbotBarcodeScannerViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/documents/CommonFieldType.d.ts +1 -1
- package/lib/typescript/src/utils/json/JsonSerializationTypes.d.ts +1 -1
- package/package.json +6 -11
- package/src/barcode/BarcodeConfigurationTypes.ts +19 -19
- package/src/barcode/BarcodeTypes.ts +1 -1
- package/src/component/barcode-camera-view/ScanbotBarcodeCameraView.tsx +11 -4
- package/src/component/barcode-camera-view/ScanbotBarcodeCameraViewProperties.ts +6 -1
- package/src/component/spec/ScanbotBarcodeScannerViewNativeComponent.ts +1 -0
- package/src/documents/CommonFieldType.ts +1 -1
- package/src/utils/json/JsonSerializationTypes.ts +1 -1
package/Libraries.txt
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Open Source libraries used in the Scanbot Barcode SDK for React Native version 7.0.0
|
|
2
2
|
|
|
3
|
-
Open Source libraries used in ScanbotBarcodeScannerSDK for iOS version 7.0.
|
|
3
|
+
Open Source libraries used in ScanbotBarcodeScannerSDK for iOS version 7.0.2:
|
|
4
4
|
|
|
5
5
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
6
6
|
|
|
7
7
|
Boost C++
|
|
8
8
|
|
|
9
|
-
Version 1.
|
|
9
|
+
Version 1.88.0
|
|
10
10
|
(https://github.com/boostorg/boost)
|
|
11
11
|
|
|
12
12
|
Boost Software License - Version 1.0 - August 17th, 2003
|
|
@@ -1980,7 +1980,7 @@ Version 1.1.1t
|
|
|
1980
1980
|
|
|
1981
1981
|
spdlog
|
|
1982
1982
|
|
|
1983
|
-
Version v1.
|
|
1983
|
+
Version v1.15.2
|
|
1984
1984
|
(https://github.com/gabime/spdlog)
|
|
1985
1985
|
|
|
1986
1986
|
The MIT License (MIT)
|
|
@@ -2525,7 +2525,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
2525
2525
|
|
|
2526
2526
|
xsimd
|
|
2527
2527
|
|
|
2528
|
-
Version 13.
|
|
2528
|
+
Version 13.2.0
|
|
2529
2529
|
(https://github.com/xtensor-stack/xsimd)
|
|
2530
2530
|
|
|
2531
2531
|
Copyright (c) 2016, Johan Mabille, Sylvain Corlay, Wolf Vollprecht and Martin Renou
|
|
@@ -2563,7 +2563,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
2563
2563
|
|
|
2564
2564
|
xtensor
|
|
2565
2565
|
|
|
2566
|
-
Version 0.
|
|
2566
|
+
Version 0.26.0-scanbot
|
|
2567
2567
|
(https://github.com/doo/xtensor)
|
|
2568
2568
|
|
|
2569
2569
|
Copyright (c) 2016, Johan Mabille, Sylvain Corlay and Wolf Vollprecht
|
|
@@ -2600,7 +2600,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
2600
2600
|
|
|
2601
2601
|
xtl
|
|
2602
2602
|
|
|
2603
|
-
Version 0.
|
|
2603
|
+
Version 0.8.0
|
|
2604
2604
|
(https://github.com/xtensor-stack/xtl)
|
|
2605
2605
|
|
|
2606
2606
|
BSD 3-Clause License
|
|
@@ -2891,7 +2891,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
2891
2891
|
|
|
2892
2892
|
------------------------------------------------------------------------------------------------------------------------
|
|
2893
2893
|
|
|
2894
|
-
Open Source libraries used in the Scanbot Barcode Scanner SDK for Android version 7.0.
|
|
2894
|
+
Open Source libraries used in the Scanbot Barcode Scanner SDK for Android version 7.0.2
|
|
2895
2895
|
CWAC-Camera
|
|
2896
2896
|
|
|
2897
2897
|
Version 0.6.42
|
|
@@ -2937,7 +2937,7 @@ limitations under the License.
|
|
|
2937
2937
|
|
|
2938
2938
|
Kotlin Standard Library
|
|
2939
2939
|
|
|
2940
|
-
Version 1.9.
|
|
2940
|
+
Version 1.9.25
|
|
2941
2941
|
(https://github.com/JetBrains/kotlin)
|
|
2942
2942
|
|
|
2943
2943
|
Copyright 2010-2018 JetBrains s.r.o.
|
|
@@ -2988,26 +2988,6 @@ See the License for the specific language governing permissions and
|
|
|
2988
2988
|
limitations under the License.
|
|
2989
2989
|
|
|
2990
2990
|
|
|
2991
|
-
|
|
2992
|
-
Google Accompanist Libraries
|
|
2993
|
-
A collection of extension libraries for Jetpack Compose
|
|
2994
|
-
Version 0.34.0
|
|
2995
|
-
(https://github.com/google/accompanist/blob/main/LICENSE)
|
|
2996
|
-
|
|
2997
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
2998
|
-
you may not use this file except in compliance with the License.
|
|
2999
|
-
You may obtain a copy of the License at
|
|
3000
|
-
|
|
3001
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
3002
|
-
|
|
3003
|
-
Unless required by applicable law or agreed to in writing, software
|
|
3004
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
3005
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3006
|
-
See the License for the specific language governing permissions and
|
|
3007
|
-
limitations under the License.
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
2991
|
google-gson
|
|
3012
2992
|
Version 2.9.1
|
|
3013
2993
|
(https://github.com/google/gson/blob/gson-parent-2.9.1/LICENSE)
|
|
@@ -3087,7 +3067,7 @@ limitations under the License.+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
|
3087
3067
|
|
|
3088
3068
|
Boost C++
|
|
3089
3069
|
|
|
3090
|
-
Version 1.
|
|
3070
|
+
Version 1.88.0
|
|
3091
3071
|
(https://github.com/boostorg/boost)
|
|
3092
3072
|
|
|
3093
3073
|
Boost Software License - Version 1.0 - August 17th, 2003
|
|
@@ -5060,7 +5040,7 @@ Version 1.1.0h
|
|
|
5060
5040
|
|
|
5061
5041
|
spdlog
|
|
5062
5042
|
|
|
5063
|
-
Version v1.
|
|
5043
|
+
Version v1.15.2
|
|
5064
5044
|
(https://github.com/gabime/spdlog)
|
|
5065
5045
|
|
|
5066
5046
|
The MIT License (MIT)
|
|
@@ -5605,7 +5585,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
5605
5585
|
|
|
5606
5586
|
xsimd
|
|
5607
5587
|
|
|
5608
|
-
Version 13.
|
|
5588
|
+
Version 13.2.0
|
|
5609
5589
|
(https://github.com/xtensor-stack/xsimd)
|
|
5610
5590
|
|
|
5611
5591
|
Copyright (c) 2016, Johan Mabille, Sylvain Corlay, Wolf Vollprecht and Martin Renou
|
|
@@ -5643,7 +5623,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
5643
5623
|
|
|
5644
5624
|
xtensor
|
|
5645
5625
|
|
|
5646
|
-
Version 0.
|
|
5626
|
+
Version 0.26.0-scanbot
|
|
5647
5627
|
(https://github.com/doo/xtensor)
|
|
5648
5628
|
|
|
5649
5629
|
Copyright (c) 2016, Johan Mabille, Sylvain Corlay and Wolf Vollprecht
|
|
@@ -5680,7 +5660,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
5680
5660
|
|
|
5681
5661
|
xtl
|
|
5682
5662
|
|
|
5683
|
-
Version 0.
|
|
5663
|
+
Version 0.8.0
|
|
5684
5664
|
(https://github.com/xtensor-stack/xtl)
|
|
5685
5665
|
|
|
5686
5666
|
BSD 3-Clause License
|
package/README.md
CHANGED
|
@@ -1,51 +1,284 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="left">
|
|
2
|
+
<img src="https://scanbot.io/wp-content/uploads/2025/04/ScanbotSDKLogo_forReadMes.png" width="15%" />
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
The [Scanbot React Native Barcode Scanner](https://scanbot.io/developer/react-native-barcode-scanner/)
|
|
5
|
-
enables you to easily implement the Scanbot
|
|
6
|
-
[Barcode Scanner SDK](https://scanbot.io/products/barcode-software/barcode-sdk/) for iOS and Android.
|
|
5
|
+
# Scanbot React Native Barcode Scanner SDK
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
and let your users easily scan any barcode in your application.
|
|
7
|
+
## Table of contents
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
[
|
|
14
|
-
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
19
|
-
[
|
|
20
|
-
[
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
[
|
|
24
|
-
[
|
|
25
|
-
[
|
|
26
|
-
[
|
|
27
|
-
[
|
|
28
|
-
[
|
|
29
|
-
[
|
|
30
|
-
[
|
|
31
|
-
Check out the [demo](https://scanbot.io/trial/demo-app/).
|
|
9
|
+
* [About the Scanbot Barcode Scanner SDK](#about-the-scanbot-barcode-scanner-sdk)
|
|
10
|
+
* [Supported barcode types](#supported-barcode-types)
|
|
11
|
+
* [Changelog](#changelog)
|
|
12
|
+
* [How to use the SDK](#how-to-use-the-sdk)
|
|
13
|
+
* [Installation](#installation)
|
|
14
|
+
* [Requirements](#requirements)
|
|
15
|
+
* [Install steps](#install-steps)
|
|
16
|
+
* [Camera permissions](#camera-permissions)
|
|
17
|
+
* [SDK initialization](#sdk-initialization)
|
|
18
|
+
* [Barcode scanner setup](#barcode-scanner-setup)
|
|
19
|
+
* [Scanning modes](#scanning-modes)
|
|
20
|
+
* [Single Scanning](#single-scanning)
|
|
21
|
+
* [Multi Scanning](#multi-scanning)
|
|
22
|
+
* [Find & Pick](#find--pick)
|
|
23
|
+
* [Configuration options](#configuration-options)
|
|
24
|
+
* [UI customization](#ui-customization)
|
|
25
|
+
* [Additional information](#additional-information)
|
|
26
|
+
* [Trial license](#trial-license)
|
|
27
|
+
* [Free developer support](#free-developer-support)
|
|
28
|
+
* [Guides and tutorials](#guides-and-tutorials)
|
|
32
29
|
|
|
30
|
+
## About the Scanbot Barcode Scanner SDK
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
To integrate this plugin into your application please follow the steps in our documentation and check out our
|
|
36
|
-
[example app](https://github.com/doo/scanbot-barcode-scanner-sdk-example-react-native).
|
|
32
|
+
The Scanbot [Barcode Scanner SDK](https://scanbot.io/barcode-scanner-sdk/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites) provides intuitive APIs to integrate fast, reliable barcode scanning into your React Native app.
|
|
37
33
|
|
|
34
|
+
It works entirely offline and scans barcodes in 0.04 seconds, even in challenging conditions like poor lighting or with damaged codes.
|
|
38
35
|
|
|
39
|
-
|
|
40
|
-
For a detailed list of the changes included in each version, please see the
|
|
41
|
-
[changelog](https://docs.scanbot.io/barcode-scanner-sdk/react-native/changelog/).
|
|
36
|
+
💡 For more details, check out our [documentation](https://docs.scanbot.io/barcode-scanner-sdk/react-native/introduction/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites) or see our [example app](https://github.com/doo/scanbot-barcode-scanner-sdk-example-react-native).
|
|
42
37
|
|
|
38
|
+
### Supported barcode types
|
|
43
39
|
|
|
44
|
-
|
|
45
|
-
The Scanbot SDK will run without a license for one minute per session! To get an unrestricted, "no-strings-attached" 7-day trial license, please submit the [Trial License Form](https://scanbot.io/trial/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites) on our website.
|
|
40
|
+
Our library supports all common 1D and 2D barcodes and multiple postal symbologies, including:
|
|
46
41
|
|
|
47
|
-
|
|
42
|
+
| Barcode type | Symbologies |
|
|
43
|
+
|:-------------------|:-------------------------------------------|
|
|
44
|
+
| 1D Barcodes | [EAN](https://scanbot.io/barcode-scanner-sdk/ean/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites), [UPC](https://scanbot.io/barcode-scanner-sdk/upc/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites), [Code 128](https://scanbot.io/barcode-scanner-sdk/code-128/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites), [GS1-128](https://scanbot.io/barcode-scanner-sdk/gs1-128/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites), [Code 39](https://scanbot.io/barcode-scanner-sdk/code-39/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites), [Codabar](https://scanbot.io/barcode-scanner-sdk/codabar/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites), [ITF](https://scanbot.io/barcode-scanner-sdk/itf-code/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites), Code 25, Code 32, Code 93, Code 11, MSI Plessey, Standard 2 of 5, IATA 2 of 5, Databar (RSS), GS1 Composite |
|
|
45
|
+
| 2D Barcodes | [QR Code](https://scanbot.io/glossary/qr-code/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites), [Micro QR Code](https://scanbot.io/barcode-scanner-sdk/micro-qr-code/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites), [Aztec Code](https://scanbot.io/barcode-scanner-sdk/aztec-code/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites), [PDF417 Code](https://scanbot.io/barcode-scanner-sdk/pdf417/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites), [Data Matrix Code](https://scanbot.io/barcode-scanner-sdk/data-matrix/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites), [GiroCode](https://scanbot.io/glossary/giro-code/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites), [PPN](https://scanbot.io/glossary/ppn/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites), [UDI](https://scanbot.io/glossary/udi/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites), [Royal Mail Mailmark](https://scanbot.io/barcode-scanner-sdk/royal-mail/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites), MaxiCode |
|
|
46
|
+
| Postal Symbologies | USPS Intelligent Mail Barcode (IMb), RM4SCC Barcode and Mailmark, Australia Post 4-State Customer Code, Japan Post 4-State Customer Code, KIX |
|
|
48
47
|
|
|
48
|
+
💡 Please visit our [docs](https://docs.scanbot.io/barcode-scanner-sdk/react-native/supported-barcodes/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites) for a complete overview of the supported barcode symbologies.
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
### Changelog
|
|
51
|
+
|
|
52
|
+
For a detailed list of changes in each version, see the [changelog](https://docs.scanbot.io/barcode-scanner-sdk/react-native/changelog/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites).
|
|
53
|
+
|
|
54
|
+
## How to use the SDK
|
|
55
|
+
|
|
56
|
+
### Installation
|
|
57
|
+
|
|
58
|
+
#### Requirements
|
|
59
|
+
|
|
60
|
+
Check out our [documentation](https://docs.scanbot.io/barcode-scanner-sdk/react-native/introduction/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites#requirements) for a full overview of our SDK's requirements.
|
|
61
|
+
|
|
62
|
+
#### Install steps
|
|
63
|
+
|
|
64
|
+
Install the Scanbot Barcode Scanner SDK module by running:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# Using Yarn
|
|
68
|
+
yarn add react-native-scanbot-barcode-scanner-sdk
|
|
69
|
+
|
|
70
|
+
# Using npm
|
|
71
|
+
npm install react-native-scanbot-barcode-scanner-sdk
|
|
72
|
+
|
|
73
|
+
# Using Expo
|
|
74
|
+
npx expo install react-native-scanbot-barcode-scanner-sdk
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
##### Expo integration
|
|
78
|
+
|
|
79
|
+
Expo projects require a development build. Configure the project using our config plugin by adding this to your app config file:
|
|
80
|
+
|
|
81
|
+
```json
|
|
82
|
+
"plugins": [
|
|
83
|
+
[
|
|
84
|
+
"react-native-scanbot-barcode-scanner-sdk",
|
|
85
|
+
{
|
|
86
|
+
"iOSCameraUsageDescription": "Barcode Camera permissions",
|
|
87
|
+
"androidCameraPermission": true,
|
|
88
|
+
"androidCameraFeature": true,
|
|
89
|
+
"mavenURLs": true
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
],
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
💡 See our [full installation guide](https://docs.scanbot.io/barcode-scanner-sdk/react-native/detailed-setup-guide/installation/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites) for complete details.
|
|
96
|
+
|
|
97
|
+
#### Camera permissions
|
|
98
|
+
|
|
99
|
+
Our SDK needs camera access to scan from a live camera stream.
|
|
100
|
+
|
|
101
|
+
**Note:** If you use Expo, the permissions can be configured using our config plugin, and this step can be skipped.
|
|
102
|
+
|
|
103
|
+
##### Android[](https://docs.scanbot.io/barcode-scanner-sdk/react-native/detailed-setup-guide/permissions/#android)
|
|
104
|
+
|
|
105
|
+
Add these camera permissions to your **android/app/src/main/AndroidManifest.xml**:
|
|
106
|
+
|
|
107
|
+
```xml
|
|
108
|
+
<uses-permission android:name="android.permission.CAMERA" />
|
|
109
|
+
<uses-feature android:name="android.hardware.camera" />
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
We added the uses-feature tag for better recognition in the Google Play Store ([learn more](https://developer.android.com/guide/topics/manifest/uses-feature-element)). Our Ready-to-Use UI Components handle runtime permissions automatically.
|
|
113
|
+
|
|
114
|
+
##### iOS[](https://docs.scanbot.io/barcode-scanner-sdk/react-native/detailed-setup-guide/permissions/#ios)
|
|
115
|
+
|
|
116
|
+
Add this camera permission description to **ios/{projectName}/Info.plist** inside the <dict> element:
|
|
117
|
+
|
|
118
|
+
```xml
|
|
119
|
+
<key>NSCameraUsageDescription</key>
|
|
120
|
+
<string>Camera permission is needed to scan barcodes</string>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
#### SDK initialization
|
|
124
|
+
|
|
125
|
+
Initialize the SDK before using any features, ideally when your app launches.
|
|
126
|
+
|
|
127
|
+
Add this import to the top of your file:
|
|
128
|
+
|
|
129
|
+
```ts
|
|
130
|
+
import ScanbotBarcodeSDK from 'react-native-scanbot-barcode-scanner-sdk';
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Initialize the SDK with:
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
ScanbotBarcodeSDK
|
|
137
|
+
.initializeSdk({ licenseKey: "" })
|
|
138
|
+
.then(result => console.log(result))
|
|
139
|
+
.catch(err => console.log(err));
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
💡 You can test the SDK without a license key for 60 seconds per app session. Need longer testing? Get your [free trial license key](https://scanbot.io/trial/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites).
|
|
143
|
+
|
|
144
|
+
### Barcode scanner setup
|
|
145
|
+
|
|
146
|
+
#### Scanning modes
|
|
147
|
+
|
|
148
|
+
In our ready-to-use UI, the Scanbot Barcode Scanner SDK offers the following scan modes right-out-of-the-box.
|
|
149
|
+
|
|
150
|
+
##### [Single Scanning](https://docs.scanbot.io/barcode-scanner-sdk/react-native/barcode-scanner/ui-components/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites#single-scan-with-confirmation-dialog)
|
|
151
|
+
|
|
152
|
+
This is the default scanning mode. It is optimized for detecting a single barcode at a time.
|
|
153
|
+
|
|
154
|
+
```ts
|
|
155
|
+
/**
|
|
156
|
+
* Instantiate a configuration object of BarcodeScannerScreenConfiguration and
|
|
157
|
+
* start the barcode scanner with the configuration
|
|
158
|
+
*/
|
|
159
|
+
const config = new BarcodeScannerScreenConfiguration();
|
|
160
|
+
const result = await ScanbotBarcodeSDK.startBarcodeScanner(config);
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
<p align="left">
|
|
164
|
+
<img src="https://scanbot.io/wp-content/uploads/2025/04/single-barcode-scanning-gif.gif" width="33.3%" />
|
|
165
|
+
</p>
|
|
166
|
+
|
|
167
|
+
##### [Multi Scanning](https://docs.scanbot.io/barcode-scanner-sdk/react-native/barcode-scanner/ui-components/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites#multiple-scanning)
|
|
168
|
+
|
|
169
|
+
The barcode scanner can also be configured to scan multiple barcodes in one go without closing the scanning screen. It can also count the scanned items.
|
|
170
|
+
|
|
171
|
+
```ts
|
|
172
|
+
/**
|
|
173
|
+
* Instantiate a configuration object of BarcodeScannerScreenConfiguration and
|
|
174
|
+
* start the barcode scanner with the configuration
|
|
175
|
+
*/
|
|
176
|
+
const config = new BarcodeScannerScreenConfiguration();
|
|
177
|
+
config.useCase = new MultipleScanningMode();
|
|
178
|
+
const result = await ScanbotBarcodeSDK.startBarcodeScanner(config);
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
<p align="left">
|
|
182
|
+
<img src="https://scanbot.io/wp-content/uploads/2025/04/multi-barcode-scanning-gif2.gif" width="33.3%"/>
|
|
183
|
+
</p>
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
##### [Find & Pick](https://docs.scanbot.io/barcode-scanner-sdk/react-native/barcode-scanner/ui-components/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites#find-and-pick-scanning)
|
|
187
|
+
|
|
188
|
+
Given one or more barcodes, the SDK visually highlights and scans the correct items for your users. It automatically selects the barcode with the right barcode value from your camera feed.
|
|
189
|
+
|
|
190
|
+
```ts
|
|
191
|
+
/**
|
|
192
|
+
* Instantiate a configuration object of BarcodeScannerScreenConfiguration and
|
|
193
|
+
* start the barcode scanner with the configuration
|
|
194
|
+
*/
|
|
195
|
+
const config = new BarcodeScannerScreenConfiguration();
|
|
196
|
+
config.useCase = new FindAndPickScanningMode();
|
|
197
|
+
config.useCase.expectedBarcodes = [
|
|
198
|
+
new ExpectedBarcode({
|
|
199
|
+
barcodeValue: '123456',
|
|
200
|
+
title: 'numeric barcode',
|
|
201
|
+
count: 4,
|
|
202
|
+
image: 'https://avatars.githubusercontent.com/u/1454920',
|
|
203
|
+
}),
|
|
204
|
+
new ExpectedBarcode({
|
|
205
|
+
barcodeValue: 'SCANBOT',
|
|
206
|
+
title: 'value barcode',
|
|
207
|
+
count: 3,
|
|
208
|
+
image: 'https://avatars.githubusercontent.com/u/1454920',
|
|
209
|
+
}),
|
|
210
|
+
];
|
|
211
|
+
const result = await ScanbotBarcodeSDK.startBarcodeScanner(config);
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
<p align="left">
|
|
215
|
+
<img src="https://scanbot.io/wp-content/uploads/2025/04/find-and-pick-barcode-scanning-gif.gif" width="33.3%"/>
|
|
216
|
+
</p>
|
|
217
|
+
|
|
218
|
+
#### Configuration options
|
|
219
|
+
|
|
220
|
+
The Scanbot React Native Barcode Scanner SDK offers numerous configuration options:
|
|
221
|
+
|
|
222
|
+
* **Barcode filters**: Apply filters by barcode type or content, with regex pattern support to capture only relevant barcodes.
|
|
223
|
+
|
|
224
|
+
* **[AR overlay](https://docs.scanbot.io/barcode-scanner-sdk/react-native/barcode-scanner/ui-components/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites#ar-overlay)**: Optional feature providing real-time barcode highlighting, preview, and tap-to-select functionality. Recognized barcodes are highlighted with customizable frames and text.
|
|
225
|
+
|
|
226
|
+
* **[Barcode parsers](https://docs.scanbot.io/barcode-scanner-sdk/react-native/supported-barcodes/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites#data-parsers)**: Extract structured information from 2D barcodes like QR and Data Matrix codes. These include parsers for documents such as driving licenses (AAMVA), boarding passes, medical certificates, SEPA forms, Swiss QR codes, and vCard business cards.
|
|
227
|
+
|
|
228
|
+
* **[Scanning barcodes from an image](https://docs.scanbot.io/barcode-scanner-sdk/react-native/barcode-scanner/detection-on-the-image/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites)**: Detect barcodes from still images in JPG or other formats, with support for single and multi-image detection.
|
|
229
|
+
|
|
230
|
+
#### UI customization
|
|
231
|
+
|
|
232
|
+
Customize the UI to match your app's look and feel. Please refer to our [documentation](https://docs.scanbot.io/barcode-scanner-sdk/react-native/barcode-scanner/ui-components/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites#change-the-visuals-to-suit-your-needs) for a full overview of the visual configuration options.
|
|
233
|
+
|
|
234
|
+
* **Configuring UI Elements:** Tailor interface elements with custom guidance text, enable or disable the Top Bar, or configure the Action Bar with features like Flashlight and Zoom buttons.
|
|
235
|
+
|
|
236
|
+
* **Palette:** Configure your UI's color palette to match your brand design for a cohesive user experience.
|
|
237
|
+
|
|
238
|
+
* **Localization:** Easily localize strings displayed on buttons, labels, and text fields.
|
|
239
|
+
|
|
240
|
+
```ts
|
|
241
|
+
// Example for configuring the Scanbot SDK's UI customization options
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Instantiate a configuration object of BarcodeScannerScreenConfiguration and
|
|
245
|
+
* start the barcode scanner with the configuration
|
|
246
|
+
*/
|
|
247
|
+
const config = new BarcodeScannerScreenConfiguration();
|
|
248
|
+
|
|
249
|
+
// Adjusting the text for your user guidance
|
|
250
|
+
config.localization.userGuidance = 'Please hold your camera over the barcode';
|
|
251
|
+
|
|
252
|
+
// Adjusting the text on the 'Cancel' Button
|
|
253
|
+
config.localization.topBarCancelButton = 'Dismiss';
|
|
254
|
+
|
|
255
|
+
// Changing the color palette
|
|
256
|
+
config.palette.sbColorPrimary = '#000000';
|
|
257
|
+
config.palette.sbColorNegative = '#ff3737';
|
|
258
|
+
|
|
259
|
+
const result = await ScanbotBarcodeSDK.startBarcodeScanner(config);
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
## Additional information
|
|
263
|
+
|
|
264
|
+
### Trial license
|
|
265
|
+
|
|
266
|
+
The Scanbot SDK will run for one minute per session without a license. After that, all functionalities and UI components will stop working.
|
|
267
|
+
|
|
268
|
+
To try the React Native Barcode Scanner SDK without the one-minute limit, you can request a free, no-strings-attached [7-day trial license](https://scanbot.io/trial/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites).
|
|
269
|
+
|
|
270
|
+
Our pricing model is simple: Unlimited barcode scanning for a flat annual license fee, full support included. There are no tiers, usage charges, or extra fees. [Contact our team](https://scanbot.io/contact-sales/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites) to receive your quote.
|
|
271
|
+
|
|
272
|
+
### Free developer support
|
|
273
|
+
|
|
274
|
+
Need help integrating or testing our Barcode Scanner SDK in your React Native project? We offer [free developer support](https://docs.scanbot.io/support/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites) via Slack, MS Teams, or email.
|
|
275
|
+
|
|
276
|
+
As a customer, you also get access to a dedicated support Slack or Microsoft Teams channel to talk directly to your Customer Success Manager and our engineers.
|
|
277
|
+
|
|
278
|
+
### Guides and tutorials
|
|
279
|
+
|
|
280
|
+
Do you want to enable your app to scan barcodes or QR codes? Integrating the Scanbot React Native Barcode Scanner plugin into your mobile app takes just a few minutes.
|
|
281
|
+
|
|
282
|
+
💡 Our [React Native Barcode Scanner tutorial](https://scanbot.io/techblog/react-native-scanner-tutorial/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites) walks you through the integration process step by step. Follow along to implement a powerful QR code scanner feature quickly.
|
|
283
|
+
|
|
284
|
+
Alternatively, check out our [developer blog](https://scanbot.io/techblog/?utm_source=npmjs.com&utm_medium=referral&utm_campaign=dev_sites) for a collection of in-depth tutorials, use cases, and best practices.
|
package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule.kt
CHANGED
|
@@ -112,7 +112,7 @@ class ScanbotBarcodeSdkModule(reactContext: ReactApplicationContext) :
|
|
|
112
112
|
@ReactMethod
|
|
113
113
|
fun getImageData(imageUri: String, promise: Promise) {
|
|
114
114
|
SBBImageOperations.getImageData(
|
|
115
|
-
imageUri, ScanbotBarcodeSdkPluginResultDelegate
|
|
115
|
+
imageUri, ScanbotBarcodeSdkPluginResultDelegate(promise)
|
|
116
116
|
)
|
|
117
117
|
}
|
|
118
118
|
|
|
@@ -7,9 +7,9 @@ import io.scanbot.sdk_wrapper.interfaces.SBResultDelegate
|
|
|
7
7
|
import org.json.JSONArray
|
|
8
8
|
import org.json.JSONObject
|
|
9
9
|
|
|
10
|
-
class ScanbotBarcodeSdkPluginResultDelegate
|
|
10
|
+
class ScanbotBarcodeSdkPluginResultDelegate(private val promise: Promise) : SBResultDelegate {
|
|
11
11
|
|
|
12
|
-
override fun onResolvePromise(result:
|
|
12
|
+
override fun onResolvePromise(result: Any?) {
|
|
13
13
|
when (result) {
|
|
14
14
|
is JSONArray -> promise.resolve(result.toWritableArray())
|
|
15
15
|
|
|
@@ -325,6 +325,11 @@ class ScanbotBarcodeScannerViewManager : SimpleViewManager<ScanbotBarcodeScanner
|
|
|
325
325
|
})
|
|
326
326
|
}
|
|
327
327
|
|
|
328
|
+
@ReactProp(name = "hardwareButtonsEnabled")
|
|
329
|
+
override fun setHardwareButtonsEnabled(view: ScanbotBarcodeScannerView?, value: Boolean) {
|
|
330
|
+
// iOS only
|
|
331
|
+
}
|
|
332
|
+
|
|
328
333
|
// endregion
|
|
329
334
|
}
|
|
330
335
|
|
|
@@ -58,6 +58,9 @@ public class ScanbotBarcodeScannerViewManagerDelegate<T extends View, U extends
|
|
|
58
58
|
case "cameraModule":
|
|
59
59
|
mViewManager.setCameraModule(view, value == null ? "BACK" : (String) value);
|
|
60
60
|
break;
|
|
61
|
+
case "hardwareButtonsEnabled":
|
|
62
|
+
mViewManager.setHardwareButtonsEnabled(view, value == null ? true : (boolean) value);
|
|
63
|
+
break;
|
|
61
64
|
case "scanningEnabled":
|
|
62
65
|
mViewManager.setScanningEnabled(view, value == null ? true : (boolean) value);
|
|
63
66
|
break;
|
|
@@ -26,6 +26,7 @@ public interface ScanbotBarcodeScannerViewManagerInterface<T extends View> {
|
|
|
26
26
|
void setCameraZoomFactor(T view, float value);
|
|
27
27
|
void setCameraZoomRange(T view, @Nullable ReadableMap value);
|
|
28
28
|
void setCameraModule(T view, @Nullable String value);
|
|
29
|
+
void setHardwareButtonsEnabled(T view, boolean value);
|
|
29
30
|
void setScanningEnabled(T view, boolean value);
|
|
30
31
|
void setMinFocusDistanceLock(T view, boolean value);
|
|
31
32
|
void setOverlayEnabled(T view, boolean value);
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
@interface RNScanbotBarcodeScannerLegacyView()
|
|
6
6
|
@property (strong, nonatomic) SBSDKBarcodeScannerViewController *scannerViewController;
|
|
7
|
-
@property (strong, nonatomic) UIViewController *vc;
|
|
8
7
|
@property (nonatomic) BOOL scanningEnabled;
|
|
8
|
+
@property (nonatomic) BOOL attached;
|
|
9
9
|
@property (nonatomic) NSString* _Nullable barcodeItemOverlayViewLoadingText;
|
|
10
10
|
@property (atomic) NSMutableDictionary* _Nullable barcodeItemOverlayViewBinders;
|
|
11
11
|
@end
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
@implementation RNScanbotBarcodeScannerLegacyView
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
|
|
17
16
|
- (instancetype)initWithFrame:(CGRect)frame
|
|
18
17
|
{
|
|
19
18
|
|
|
@@ -21,9 +20,8 @@
|
|
|
21
20
|
_scanningEnabled = true;
|
|
22
21
|
_barcodeItemOverlayViewLoadingText = nil;
|
|
23
22
|
_barcodeItemOverlayViewBinders = nil;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
self.vc.view = self;
|
|
23
|
+
self.attached = false;
|
|
24
|
+
|
|
27
25
|
self.scannerViewController = [RNScanbotBarcodeScannerViewControllerWrapper initController];
|
|
28
26
|
self.scannerViewController.delegate = self;
|
|
29
27
|
self.scannerViewController.trackingOverlayController.delegate = self;
|
|
@@ -34,23 +32,27 @@
|
|
|
34
32
|
|
|
35
33
|
- (void)didMoveToWindow {
|
|
36
34
|
[super didMoveToWindow];
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
|
|
36
|
+
if(self.window && !self.attached){
|
|
37
|
+
[[self reactViewController] sbsdk_attachViewController:self.scannerViewController inView:self];
|
|
38
|
+
self.attached = true;
|
|
41
39
|
}
|
|
42
40
|
}
|
|
43
41
|
|
|
44
42
|
- (void)removeFromSuperview {
|
|
43
|
+
|
|
44
|
+
self.scannerViewController.delegate = nil;
|
|
45
|
+
self.scannerViewController.trackingOverlayController.delegate = nil;
|
|
46
|
+
|
|
47
|
+
[self.scannerViewController sbsdk_detachViewController:self.scannerViewController];
|
|
45
48
|
self.scannerViewController = nil;
|
|
46
|
-
|
|
49
|
+
|
|
47
50
|
self.barcodeItemOverlayViewLoadingText = nil;
|
|
48
51
|
self.barcodeItemOverlayViewBinders = nil;
|
|
49
52
|
|
|
50
53
|
[super removeFromSuperview];
|
|
51
54
|
}
|
|
52
55
|
|
|
53
|
-
|
|
54
56
|
- (void) setScanningEnabled:(BOOL)value {
|
|
55
57
|
_scanningEnabled = value;
|
|
56
58
|
}
|
|
@@ -217,6 +219,10 @@
|
|
|
217
219
|
}
|
|
218
220
|
}
|
|
219
221
|
|
|
222
|
+
- (void) setHardwareButtonsEnabled:(BOOL) value {
|
|
223
|
+
[RNScanbotBarcodeScannerViewControllerWrapper setHardwareButtonsEnabled:self.scannerViewController value:value];
|
|
224
|
+
}
|
|
225
|
+
|
|
220
226
|
- (void) freezeCamera {
|
|
221
227
|
[RNScanbotBarcodeScannerViewControllerWrapper freezeCamera:self.scannerViewController];
|
|
222
228
|
}
|