@cleanuidev/react-native-scanner 1.0.0-beta.1 → 1.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,14 +4,16 @@
4
4
 
5
5
  **A powerful, native barcode and QR code scanner for React Native**
6
6
 
7
+ ![React Native Barcode Scanner Demo - QR Code and Barcode Scanning with Focus Area](./preview.gif)
8
+
7
9
  [![npm version](https://img.shields.io/npm/v/@cleanuidev/react-native-scanner?label=beta&color=blue)](https://www.npmjs.com/package/@cleanuidev/react-native-scanner)
8
10
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
- [![Platform](https://img.shields.io/badge/Platform-Android-blue.svg)](https://www.android.com/)
11
+ [![Platform](https://img.shields.io/badge/Platform-Android%20%7C%20iOS-blue.svg)](https://reactnative.dev/)
10
12
  [![React Native](https://img.shields.io/badge/React%20Native-0.83+-61DAFB?logo=react)](https://reactnative.dev/)
11
13
 
12
14
  **Built with ❤️ by [CleanUI.dev](https://cleanui.dev)**
13
15
 
14
- [Features](#-features) • [Installation](#-installation) • [Documentation](#-documentation) • [Support](#-consulting--support)
16
+ [Features](#-features) • [Installation](#-installation) • [Documentation](#-documentation)
15
17
 
16
18
  </div>
17
19
 
@@ -23,12 +25,12 @@
23
25
 
24
26
  | Feature | Description |
25
27
  |:------:|:-----------|
26
- | 🚀 **Native Performance** | Built with CameraX and ML Kit for optimal performance |
28
+ | 🚀 **Native Performance** | Built with CameraX & ML Kit (Android) and AVFoundation & Vision (iOS) for optimal performance |
27
29
  | 🎯 **Focus Area** | Configurable focus area with optional overlay for precise scanning |
28
30
  | 🔦 **Torch Control** | Built-in flashlight/torch control |
29
31
  | 📊 **Multiple Formats** | Support for QR codes, Code128, Code39, EAN, UPC, and more |
30
32
  | 🎨 **Customizable** | Configurable focus area colors, barcode frame visualization, and scanning behavior |
31
- | 📱 **Cross Platform** | Android support (iOS coming soon) |
33
+ | 📱 **Cross Platform** | Android & iOS support (new Fabric architecture) |
32
34
 
33
35
  </div>
34
36
 
@@ -56,13 +58,15 @@ npm install @cleanuidev/react-native-scanner@1.0.0-beta.1
56
58
  yarn add @cleanuidev/react-native-scanner@1.0.0-beta.1
57
59
  ```
58
60
 
59
- > **💡 Note**: Once the library reaches stable release (1.0.0), you can install it without the `@beta` tag:
61
+ > **Note**: Once the library reaches stable release (1.0.0), you can install it without the `@beta` tag:
60
62
  > ```bash
61
63
  > npm install @cleanuidev/react-native-scanner
62
64
  > # or
63
65
  > yarn add @cleanuidev/react-native-scanner
64
66
  > ```
65
67
 
68
+ ## Platform Setup
69
+
66
70
  ### Android Setup
67
71
 
68
72
  Add the following permissions to your `android/app/src/main/AndroidManifest.xml`:
@@ -75,9 +79,22 @@ Add the following permissions to your `android/app/src/main/AndroidManifest.xml`
75
79
  <uses-feature android:name="android.hardware.camera.flash" android:required="false" />
76
80
  ```
77
81
 
78
- ---
82
+ ### iOS Setup
79
83
 
80
- ## 🚀 Quick Start
84
+ For iOS, add camera usage description to your `ios/YourApp/Info.plist`:
85
+
86
+ ```xml
87
+ <key>NSCameraUsageDescription</key>
88
+ <string>This app needs camera access to scan barcodes and QR codes</string>
89
+ ```
90
+
91
+ Then install CocoaPods dependencies:
92
+
93
+ ```bash
94
+ cd ios && pod install && cd ..
95
+ ```
96
+
97
+ ## Usage
81
98
 
82
99
  ### Basic Scanner
83
100
 
@@ -174,34 +191,12 @@ export default function FocusAreaScanner() {
174
191
  }
175
192
  ```
176
193
 
177
- ---
178
-
179
- ## 🎨 UI Design Note
180
-
181
- > **💡 Note**: The native overlays and frames are provided to fulfill minimum design requirements and for debugging during development. We **recommend implementing custom React Native UI** for enhanced user experiences.
194
+ ## API Reference
182
195
 
183
- To use custom UI, simply disable the native visual overlays and build your own:
184
-
185
- ```tsx
186
- <ScannerView
187
- focusArea={{ enabled: true, showOverlay: false }} // Disable native overlay
188
- barcodeFrames={{ enabled: false }} // Disable native frames
189
- onBarcodeScanned={handleBarcodeScanned}
190
- />
191
- ```
192
-
193
- Then layer your custom React Native components on top for a fully branded experience.
194
-
195
- ---
196
-
197
- ## 📚 Documentation
198
-
199
- ### API Reference
200
-
201
- #### Props
196
+ ### Props
202
197
 
203
198
  | Prop | Type | Default | Description |
204
- |:----:|:----:|:-------:|:-----------|
199
+ |------|------|---------|-------------|
205
200
  | `barcodeTypes` | `BarcodeFormat[]` | `[BarcodeFormat.QR_CODE]` | Array of barcode formats to scan |
206
201
  | `focusArea` | `FocusAreaConfig` | - | Focus area configuration |
207
202
  | `barcodeFrames` | `BarcodeFramesConfig` | - | Barcode frame visualization configuration |
@@ -214,9 +209,7 @@ Then layer your custom React Native components on top for a fully branded experi
214
209
  | `onScannerError` | `function` | - | Callback when scanner encounters an error |
215
210
  | `onLoad` | `function` | - | Callback when scanner is loaded |
216
211
 
217
- #### Configuration Types
218
-
219
- ##### FocusAreaConfig
212
+ #### FocusAreaConfig
220
213
 
221
214
  ```tsx
222
215
  type FocusAreaConfig = {
@@ -227,7 +220,7 @@ type FocusAreaConfig = {
227
220
  };
228
221
  ```
229
222
 
230
- ##### BarcodeFramesConfig
223
+ #### BarcodeFramesConfig
231
224
 
232
225
  ```tsx
233
226
  type BarcodeFramesConfig = {
@@ -237,7 +230,7 @@ type BarcodeFramesConfig = {
237
230
  };
238
231
  ```
239
232
 
240
- ##### FrameSize
233
+ #### FrameSize
241
234
 
242
235
  ```tsx
243
236
  type FrameSize = number | { width: number; height: number };
@@ -257,7 +250,7 @@ BarcodeScanStrategy.BIGGEST // Process only the largest barcode by area
257
250
  BarcodeScanStrategy.SORT_BY_BIGGEST // Process all barcodes sorted by size (largest first)
258
251
  ```
259
252
 
260
- #### Barcode Formats
253
+ ### Barcode Formats
261
254
 
262
255
  ```tsx
263
256
  import { BarcodeFormat } from '@cleanuidev/react-native-scanner';
@@ -276,10 +269,9 @@ BarcodeFormat.AZTEC // Aztec
276
269
  BarcodeFormat.ITF // ITF (Interleaved 2 of 5)
277
270
  ```
278
271
 
279
- #### Event Payloads
280
-
281
- ##### onBarcodeScanned
272
+ ### Event Payloads
282
273
 
274
+ #### onBarcodeScanned
283
275
  ```tsx
284
276
  {
285
277
  nativeEvent: [
@@ -299,8 +291,7 @@ BarcodeFormat.ITF // ITF (Interleaved 2 of 5)
299
291
  }
300
292
  ```
301
293
 
302
- ##### onScannerError
303
-
294
+ #### onScannerError
304
295
  ```tsx
305
296
  {
306
297
  nativeEvent: {
@@ -310,8 +301,7 @@ BarcodeFormat.ITF // ITF (Interleaved 2 of 5)
310
301
  }
311
302
  ```
312
303
 
313
- ##### onLoad
314
-
304
+ #### onLoad
315
305
  ```tsx
316
306
  {
317
307
  nativeEvent: {
@@ -321,15 +311,11 @@ BarcodeFormat.ITF // ITF (Interleaved 2 of 5)
321
311
  }
322
312
  ```
323
313
 
324
- ---
325
-
326
- ## 🎯 Advanced Usage
327
-
328
- ### Focus Area Configuration
314
+ ## Focus Area Configuration
329
315
 
330
316
  The focus area feature provides precise control over where barcodes are scanned:
331
317
 
332
- #### Basic Focus Area
318
+ ### Basic Focus Area
333
319
 
334
320
  ```tsx
335
321
  <ScannerView
@@ -342,7 +328,7 @@ The focus area feature provides precise control over where barcodes are scanned:
342
328
  />
343
329
  ```
344
330
 
345
- #### Focus Area with Restricted Scanning
331
+ ### Focus Area with Restricted Scanning
346
332
 
347
333
  ```tsx
348
334
  <ScannerView
@@ -356,7 +342,7 @@ The focus area feature provides precise control over where barcodes are scanned:
356
342
  />
357
343
  ```
358
344
 
359
- #### Rectangular Focus Area
345
+ ### Rectangular Focus Area
360
346
 
361
347
  ```tsx
362
348
  <ScannerView
@@ -369,11 +355,11 @@ The focus area feature provides precise control over where barcodes are scanned:
369
355
  />
370
356
  ```
371
357
 
372
- ### Barcode Frame Visualization
358
+ ## Barcode Frame Visualization
373
359
 
374
360
  The scanner can display visual frames around detected barcodes to help users see what's being scanned:
375
361
 
376
- #### Show All Barcode Frames
362
+ ### Show All Barcode Frames
377
363
 
378
364
  ```tsx
379
365
  <ScannerView
@@ -385,7 +371,7 @@ The scanner can display visual frames around detected barcodes to help users see
385
371
  />
386
372
  ```
387
373
 
388
- #### Show Frames Only in Focus Area
374
+ ### Show Frames Only in Focus Area
389
375
 
390
376
  ```tsx
391
377
  <ScannerView
@@ -402,11 +388,11 @@ The scanner can display visual frames around detected barcodes to help users see
402
388
  />
403
389
  ```
404
390
 
405
- ### Barcode Scan Strategy
391
+ ## Barcode Scan Strategy
406
392
 
407
- The scanner supports different strategies for processing multiple detected barcodes. The `onBarcodeScanned` event always returns an array of barcodes, even when only one barcode is processed.
393
+ The scanner now supports different strategies for processing multiple detected barcodes. The `onBarcodeScanned` event always returns an array of barcodes, even when only one barcode is processed.
408
394
 
409
- #### Process All Barcodes (Default)
395
+ ### Process All Barcodes (Default)
410
396
 
411
397
  ```tsx
412
398
  <ScannerView
@@ -418,7 +404,7 @@ The scanner supports different strategies for processing multiple detected barco
418
404
  />
419
405
  ```
420
406
 
421
- #### Process Only the First Barcode
407
+ ### Process Only the First Barcode
422
408
 
423
409
  ```tsx
424
410
  <ScannerView
@@ -433,7 +419,7 @@ The scanner supports different strategies for processing multiple detected barco
433
419
  />
434
420
  ```
435
421
 
436
- #### Process Only the Largest Barcode
422
+ ### Process Only the Largest Barcode
437
423
 
438
424
  ```tsx
439
425
  <ScannerView
@@ -449,7 +435,7 @@ The scanner supports different strategies for processing multiple detected barco
449
435
  />
450
436
  ```
451
437
 
452
- #### Process All Barcodes Sorted by Size
438
+ ### Process All Barcodes Sorted by Size
453
439
 
454
440
  ```tsx
455
441
  <ScannerView
@@ -464,7 +450,7 @@ The scanner supports different strategies for processing multiple detected barco
464
450
  />
465
451
  ```
466
452
 
467
- ### Torch Control
453
+ ## Torch Control
468
454
 
469
455
  The torch/flashlight can be controlled via the `torch` prop:
470
456
 
@@ -477,11 +463,11 @@ const [torchEnabled, setTorchEnabled] = useState(false);
477
463
  />
478
464
  ```
479
465
 
480
- ### Keep Screen On
466
+ ## Keep Screen On
481
467
 
482
468
  The scanner automatically keeps the screen on while the camera is active to prevent auto-lock during scanning sessions. This behavior can be controlled via the `keepScreenOn` prop:
483
469
 
484
- #### Default Behavior (Screen Stays On)
470
+ ### Default Behavior (Screen Stays On)
485
471
 
486
472
  ```tsx
487
473
  <ScannerView
@@ -490,7 +476,7 @@ The scanner automatically keeps the screen on while the camera is active to prev
490
476
  />
491
477
  ```
492
478
 
493
- #### Allow Screen Auto-Lock
479
+ ### Allow Screen Auto-Lock
494
480
 
495
481
  ```tsx
496
482
  <ScannerView
@@ -499,7 +485,7 @@ The scanner automatically keeps the screen on while the camera is active to prev
499
485
  />
500
486
  ```
501
487
 
502
- #### Dynamic Control
488
+ ### Dynamic Control
503
489
 
504
490
  ```tsx
505
491
  const [keepScreenOn, setKeepScreenOn] = useState(true);
@@ -515,11 +501,23 @@ const [keepScreenOn, setKeepScreenOn] = useState(true);
515
501
  </TouchableOpacity>
516
502
  ```
517
503
 
518
- > **💡 Note**: The screen is kept on by default (`keepScreenOn={true}`) as this is typically desired for scanning applications. When disabled, the screen may auto-lock, which could interrupt scanning sessions.
504
+ **Note**: The screen is kept on by default (`keepScreenOn={true}`) as this is typically desired for scanning applications. When disabled, the screen may auto-lock, which could interrupt scanning sessions.
519
505
 
520
- ---
506
+ ## 🎨 UI Design Note
507
+
508
+ > **💡 Note**: The native overlays and frames are provided to fulfill minimum design requirements and for debugging during development. We **recommend implementing custom React Native UI** for enhanced user experiences.
509
+
510
+ To use custom UI, simply disable the native visual overlays and build your own:
511
+
512
+ ```tsx
513
+ <ScannerView
514
+ focusArea={{ enabled: true, showOverlay: false }} // Disable native overlay
515
+ barcodeFrames={{ enabled: false }} // Disable native frames
516
+ onBarcodeScanned={handleBarcodeScanned}
517
+ />
518
+ ```
521
519
 
522
- ## 🔐 Permissions
520
+ ## Permissions
523
521
 
524
522
  The scanner requires camera permissions. Make sure to request camera permissions in your app before using the scanner:
525
523
 
@@ -549,17 +547,11 @@ const requestCameraPermission = async () => {
549
547
  };
550
548
  ```
551
549
 
552
- ---
553
-
554
- ## 📖 Examples
550
+ ## Example
555
551
 
556
552
  See the `example/` directory for complete working examples, including the "New Props Example" that demonstrates the updated prop structure.
557
553
 
558
- ---
559
-
560
- ## 🤝 Contributing
561
-
562
- We welcome contributions! Please follow these steps:
554
+ ## Contributing
563
555
 
564
556
  1. Fork the repository
565
557
  2. Create your feature branch (`git checkout -b feature/amazing-feature`)
@@ -567,10 +559,6 @@ We welcome contributions! Please follow these steps:
567
559
  4. Push to the branch (`git push origin feature/amazing-feature`)
568
560
  5. Open a Pull Request
569
561
 
570
- For more details, see our [Contributing Guide](CONTRIBUTING.md).
571
-
572
- ---
573
-
574
562
  ## 💼 Consulting & Support
575
563
 
576
564
  ### Community Support (Free)
@@ -594,16 +582,10 @@ Need professional help with implementation, custom development, or enterprise su
594
582
 
595
583
  ---
596
584
 
597
- ## 📄 License
585
+ ## License
598
586
 
599
587
  This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
600
588
 
601
589
  ---
602
590
 
603
- <div align="center">
604
-
605
- **Made with ❤️ by [CleanUI.dev](https://cleanui.dev)**
606
-
607
- [Website](https://cleanui.dev) • [GitHub](https://github.com/cleanui-dev) • [Support](mailto:hi@cleanuitechnologies.com)
608
-
609
- </div>
591
+ Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
package/Scanner.podspec CHANGED
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
11
11
  s.authors = package["author"]
12
12
 
13
13
  s.platforms = { :ios => min_ios_version_supported }
14
- s.source = { :git => "https://github.com/cleanui-dev/react-native-scanner.git", :tag => "#{s.version}" }
14
+ s.source = { :git => "https://github.com/rahulgwebdev/react-native-scanner.git", :tag => "#{s.version}" }
15
15
 
16
16
  s.source_files = "ios/**/*.{h,m,mm,swift,cpp}"
17
17
  s.private_header_files = "ios/**/*.h"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleanuidev/react-native-scanner",
3
- "version": "1.0.0-beta.1",
3
+ "version": "1.0.0-beta.2",
4
4
  "description": "scanner",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -49,14 +49,14 @@
49
49
  ],
50
50
  "repository": {
51
51
  "type": "git",
52
- "url": "git+https://github.com/cleanui-dev/react-native-scanner.git"
52
+ "url": "git+https://github.com/rahulgwebdev/react-native-scanner.git"
53
53
  },
54
54
  "author": "Rahul Gupta <rahulgwebdev@gmail.com> (https://github.com/rahulgwebdev)",
55
55
  "license": "MIT",
56
56
  "bugs": {
57
- "url": "https://github.com/cleanui-dev/react-native-scanner/issues"
57
+ "url": "https://github.com/rahulgwebdev/react-native-scanner/issues"
58
58
  },
59
- "homepage": "https://github.com/cleanui-dev/react-native-scanner#readme",
59
+ "homepage": "https://github.com/rahulgwebdev/react-native-scanner#readme",
60
60
  "publishConfig": {
61
61
  "registry": "https://registry.npmjs.org/",
62
62
  "access": "public"