scandit-capacitor-datacapture-barcode 7.1.2 → 7.2.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 +3 -0
- package/ScanditCapacitorDatacaptureBarcode.podspec +1 -1
- package/android/build.gradle +36 -3
- package/android/src/main/java/com/scandit/capacitor/datacapture/barcode/ScanditBarcodeNative.kt +81 -86
- package/dist/barcode.js +692 -755
- package/dist/barcode.js.map +1 -1
- package/dist/dts/definitions.d.ts +1 -103
- package/dist/dts/ts/Capacitor/BarcodeCountViewProxy.d.ts +5 -36
- package/dist/dts/ts/Capacitor/BarcodeFindViewProxy.d.ts +0 -2
- package/dist/dts/ts/Capacitor/Capacitor.d.ts +0 -9
- package/dist/dts/web.d.ts +1 -2
- package/dist/index.js +27 -453
- package/dist/index.js.map +1 -1
- package/ios/Plugin/Plugin.m +19 -21
- package/ios/Plugin/ScanditBarcodeCapture.swift +169 -155
- package/package.json +11 -7
- package/dist/dts/ts/Capacitor/BarcodeCaptureListenerProxy.d.ts +0 -21
- package/dist/dts/ts/Capacitor/BarcodeCountListenerProxy.d.ts +0 -21
- package/dist/dts/ts/Capacitor/BarcodeCountSessionProxy.d.ts +0 -7
- package/dist/dts/ts/Capacitor/BarcodeSelectionListenerProxy.d.ts +0 -17
- package/dist/dts/ts/Capacitor/BarcodeSelectionOverlayProxy.d.ts +0 -16
- package/dist/dts/ts/Capacitor/BarcodeSelectionProxy.d.ts +0 -14
package/ios/Plugin/Plugin.m
CHANGED
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
// each method the plugin supports using the CAP_PLUGIN_METHOD macro.
|
|
12
12
|
CAP_PLUGIN(ScanditCapacitorBarcode, "ScanditBarcodeNative",
|
|
13
13
|
CAP_PLUGIN_METHOD(getDefaults, CAPPluginReturnPromise);
|
|
14
|
-
CAP_PLUGIN_METHOD(
|
|
14
|
+
CAP_PLUGIN_METHOD(registerBarcodeCaptureListenerForEvents, CAPPluginReturnPromise);
|
|
15
|
+
CAP_PLUGIN_METHOD(unregisterBarcodeCaptureListenerForEvents, CAPPluginReturnPromise);
|
|
15
16
|
CAP_PLUGIN_METHOD(finishBarcodeCaptureDidScan, CAPPluginReturnPromise);
|
|
16
17
|
CAP_PLUGIN_METHOD(finishBarcodeCaptureDidUpdateSession, CAPPluginReturnPromise);
|
|
17
18
|
CAP_PLUGIN_METHOD(subscribeBarcodeBatchListener, CAPPluginReturnPromise);
|
|
@@ -29,8 +30,8 @@ CAP_PLUGIN(ScanditCapacitorBarcode, "ScanditBarcodeNative",
|
|
|
29
30
|
CAP_PLUGIN_METHOD(setAnchorForTrackedBarcode, CAPPluginReturnPromise);
|
|
30
31
|
CAP_PLUGIN_METHOD(setOffsetForTrackedBarcode, CAPPluginReturnPromise);
|
|
31
32
|
CAP_PLUGIN_METHOD(clearTrackedBarcodeViews, CAPPluginReturnPromise);
|
|
32
|
-
CAP_PLUGIN_METHOD(
|
|
33
|
-
CAP_PLUGIN_METHOD(
|
|
33
|
+
CAP_PLUGIN_METHOD(registerBarcodeSelectionListenerForEvents, CAPPluginReturnPromise);
|
|
34
|
+
CAP_PLUGIN_METHOD(unregisterBarcodeSelectionListenerForEvents, CAPPluginReturnPromise);
|
|
34
35
|
CAP_PLUGIN_METHOD(resetBarcodeSelection, CAPPluginReturnPromise);
|
|
35
36
|
CAP_PLUGIN_METHOD(resetBarcodeCaptureSession, CAPPluginReturnPromise);
|
|
36
37
|
CAP_PLUGIN_METHOD(resetBarcodeBatchSession, CAPPluginReturnPromise);
|
|
@@ -46,29 +47,25 @@ CAP_PLUGIN(ScanditCapacitorBarcode, "ScanditBarcodeNative",
|
|
|
46
47
|
CAP_PLUGIN_METHOD(unegisterBarcodeCountListener, CAPPluginReturnPromise);
|
|
47
48
|
CAP_PLUGIN_METHOD(unregisterBarcodeCountViewListener, CAPPluginReturnPromise);
|
|
48
49
|
CAP_PLUGIN_METHOD(unregisterBarcodeCountViewUiListener, CAPPluginReturnPromise);
|
|
49
|
-
CAP_PLUGIN_METHOD(
|
|
50
|
-
CAP_PLUGIN_METHOD(
|
|
51
|
-
CAP_PLUGIN_METHOD(
|
|
52
|
-
CAP_PLUGIN_METHOD(
|
|
53
|
-
CAP_PLUGIN_METHOD(
|
|
54
|
-
CAP_PLUGIN_METHOD(
|
|
55
|
-
CAP_PLUGIN_METHOD(
|
|
50
|
+
CAP_PLUGIN_METHOD(setBarcodeCountViewPositionAndSize, CAPPluginReturnPromise);
|
|
51
|
+
CAP_PLUGIN_METHOD(showBarcodeCountView, CAPPluginReturnPromise);
|
|
52
|
+
CAP_PLUGIN_METHOD(hideBarcodeCountView, CAPPluginReturnPromise);
|
|
53
|
+
CAP_PLUGIN_METHOD(createBarcodeCountView, CAPPluginReturnPromise);
|
|
54
|
+
CAP_PLUGIN_METHOD(removeBarcodeCountView, CAPPluginReturnPromise);
|
|
55
|
+
CAP_PLUGIN_METHOD(updateBarcodeCountView, CAPPluginReturnPromise);
|
|
56
|
+
CAP_PLUGIN_METHOD(updateBarcodeCountMode, CAPPluginReturnPromise);
|
|
56
57
|
CAP_PLUGIN_METHOD(resetBarcodeCount, CAPPluginReturnPromise);
|
|
57
58
|
CAP_PLUGIN_METHOD(resetBarcodeCountSession, CAPPluginReturnPromise);
|
|
58
|
-
CAP_PLUGIN_METHOD(
|
|
59
|
-
CAP_PLUGIN_METHOD(
|
|
59
|
+
CAP_PLUGIN_METHOD(startBarcodeCountScanningPhase, CAPPluginReturnPromise);
|
|
60
|
+
CAP_PLUGIN_METHOD(endBarcodeCountScanningPhase, CAPPluginReturnPromise);
|
|
60
61
|
CAP_PLUGIN_METHOD(clearBarcodeCountViewHighlights, CAPPluginReturnPromise);
|
|
61
62
|
CAP_PLUGIN_METHOD(setBarcodeCountCaptureList, CAPPluginReturnPromise);
|
|
62
|
-
CAP_PLUGIN_METHOD(
|
|
63
|
-
CAP_PLUGIN_METHOD(
|
|
63
|
+
CAP_PLUGIN_METHOD(finishBarcodeCountOnScan, CAPPluginReturnPromise);
|
|
64
|
+
CAP_PLUGIN_METHOD(finishBarcodeCountBrushForRecognizedBarcode, CAPPluginReturnPromise);
|
|
65
|
+
CAP_PLUGIN_METHOD(finishBarcodeCountBrushForRecognizedBarcodeNotInList,
|
|
64
66
|
CAPPluginReturnPromise);
|
|
65
|
-
CAP_PLUGIN_METHOD(
|
|
66
|
-
|
|
67
|
-
CAP_PLUGIN_METHOD(finishBarcodeCountViewListenerOnBrushForAcceptedBarcode,
|
|
68
|
-
CAPPluginReturnPromise);
|
|
69
|
-
CAP_PLUGIN_METHOD(finishBarcodeCountViewListenerOnBrushForRejectedBarcode,
|
|
70
|
-
CAPPluginReturnPromise);
|
|
71
|
-
CAP_PLUGIN_METHOD(setBarcodeFindModeEnabledState, CAPPluginReturnPromise);
|
|
67
|
+
CAP_PLUGIN_METHOD(finishBarcodeCountBrushForAcceptedBarcode, CAPPluginReturnPromise);
|
|
68
|
+
CAP_PLUGIN_METHOD(finishBarcodeCountBrushForRejectedBarcode, CAPPluginReturnPromise);
|
|
72
69
|
CAP_PLUGIN_METHOD(setBarcodeCountModeEnabledState, CAPPluginReturnPromise);
|
|
73
70
|
CAP_PLUGIN_METHOD(updateBarcodeCountFeedback, CAPPluginReturnPromise);
|
|
74
71
|
CAP_PLUGIN_METHOD(setBarcodeBatchModeEnabledState, CAPPluginReturnPromise);
|
|
@@ -79,6 +76,7 @@ CAP_PLUGIN(ScanditCapacitorBarcode, "ScanditBarcodeNative",
|
|
|
79
76
|
CAP_PLUGIN_METHOD(removeFindView, CAPPluginReturnPromise);
|
|
80
77
|
CAP_PLUGIN_METHOD(updateFindView, CAPPluginReturnPromise);
|
|
81
78
|
CAP_PLUGIN_METHOD(updateFindMode, CAPPluginReturnPromise);
|
|
79
|
+
CAP_PLUGIN_METHOD(setBarcodeFindModeEnabledState, CAPPluginReturnPromise);
|
|
82
80
|
CAP_PLUGIN_METHOD(registerBarcodeFindListener, CAPPluginReturnPromise);
|
|
83
81
|
CAP_PLUGIN_METHOD(unregisterBarcodeFindListener, CAPPluginReturnPromise);
|
|
84
82
|
CAP_PLUGIN_METHOD(registerBarcodeFindViewListener, CAPPluginReturnPromise);
|
|
@@ -99,27 +99,33 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
99
99
|
|
|
100
100
|
@objc(getDefaults:)
|
|
101
101
|
func getDefaults(_ call: CAPPluginCall) {
|
|
102
|
-
|
|
103
|
-
var defaults = barcodeModule.defaults.toEncodable()
|
|
104
|
-
defaults["BarcodeCapture"] = barcodeCaptureModule.defaults.toEncodable()
|
|
105
|
-
defaults["BarcodeBatch"] = barcodeBatchModule.defaults.toEncodable()
|
|
106
|
-
defaults["BarcodeSelection"] = barcodeSelectionModule.defaults.toEncodable()
|
|
107
|
-
defaults["BarcodeCount"] = barcodeCountModule.defaults.toEncodable()
|
|
108
|
-
defaults["BarcodeFind"] = barcodeFindModule.defaults.toEncodable()
|
|
109
|
-
defaults["BarcodePick"] = barcodePickModule.defaults.toEncodable()
|
|
110
|
-
defaults["SparkScan"] = sparkScanModule.defaults.toEncodable()
|
|
102
|
+
dispatchMain {
|
|
103
|
+
var defaults = self.barcodeModule.defaults.toEncodable()
|
|
104
|
+
defaults["BarcodeCapture"] = self.barcodeCaptureModule.defaults.toEncodable()
|
|
105
|
+
defaults["BarcodeBatch"] = self.barcodeBatchModule.defaults.toEncodable()
|
|
106
|
+
defaults["BarcodeSelection"] = self.barcodeSelectionModule.defaults.toEncodable()
|
|
107
|
+
defaults["BarcodeCount"] = self.barcodeCountModule.defaults.toEncodable()
|
|
108
|
+
defaults["BarcodeFind"] = self.barcodeFindModule.defaults.toEncodable()
|
|
109
|
+
defaults["BarcodePick"] = self.barcodePickModule.defaults.toEncodable()
|
|
110
|
+
defaults["SparkScan"] = self.sparkScanModule.defaults.toEncodable()
|
|
111
111
|
call.resolve(defaults as PluginCallResultData)
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
// MARK: Barcode Capture
|
|
116
116
|
|
|
117
|
-
@objc(
|
|
118
|
-
func
|
|
117
|
+
@objc(registerBarcodeCaptureListenerForEvents:)
|
|
118
|
+
func registerBarcodeCaptureListenerForEvents(_ call: CAPPluginCall) {
|
|
119
119
|
barcodeCaptureModule.addListener()
|
|
120
120
|
call.resolve()
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
+
@objc(unregisterBarcodeCaptureListenerForEvents:)
|
|
124
|
+
func unregisterBarcodeCaptureListenerForEvents(_ call: CAPPluginCall) {
|
|
125
|
+
barcodeCaptureModule.removeListener()
|
|
126
|
+
call.resolve()
|
|
127
|
+
}
|
|
128
|
+
|
|
123
129
|
@objc(finishBarcodeCaptureDidScan:)
|
|
124
130
|
func finishBarcodeCaptureDidScan(_ call: CAPPluginCall) {
|
|
125
131
|
barcodeCaptureModule.finishDidScan(enabled: call.getBool("enabled", false))
|
|
@@ -293,14 +299,14 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
293
299
|
|
|
294
300
|
// MARK: Barcode Selection
|
|
295
301
|
|
|
296
|
-
@objc(
|
|
297
|
-
func
|
|
302
|
+
@objc(registerBarcodeSelectionListenerForEvents:)
|
|
303
|
+
func registerBarcodeSelectionListenerForEvents(_ call: CAPPluginCall) {
|
|
298
304
|
barcodeSelectionModule.addListener()
|
|
299
305
|
call.resolve()
|
|
300
306
|
}
|
|
301
307
|
|
|
302
|
-
@objc(
|
|
303
|
-
func
|
|
308
|
+
@objc(unregisterBarcodeSelectionListenerForEvents:)
|
|
309
|
+
func unregisterBarcodeSelectionListenerForEvents(_ call: CAPPluginCall) {
|
|
304
310
|
barcodeSelectionModule.removeListener()
|
|
305
311
|
call.resolve()
|
|
306
312
|
}
|
|
@@ -488,11 +494,28 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
488
494
|
barcodeCountModule.removeBarcodeCountViewUiListener(result: CapacitorResult(call))
|
|
489
495
|
}
|
|
490
496
|
|
|
491
|
-
@objc(
|
|
492
|
-
func
|
|
493
|
-
|
|
494
|
-
let
|
|
495
|
-
|
|
497
|
+
@objc(setBarcodeCountViewPositionAndSize:)
|
|
498
|
+
func setBarcodeCountViewPositionAndSize(_ call: CAPPluginCall) {
|
|
499
|
+
dispatchMain {
|
|
500
|
+
guard let top = call.getDouble("top"),
|
|
501
|
+
let left = call.getDouble("left"),
|
|
502
|
+
let width = call.getDouble("width"),
|
|
503
|
+
let height = call.getDouble("height")
|
|
504
|
+
else {
|
|
505
|
+
call.reject("Missing required position parameters")
|
|
506
|
+
return
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
let shouldBeUnderWebView = call.getBool("shouldBeUnderWebView", false)
|
|
510
|
+
let jsonObject: [String: Any] = [
|
|
511
|
+
"top": top,
|
|
512
|
+
"left": left,
|
|
513
|
+
"width": width,
|
|
514
|
+
"height": height,
|
|
515
|
+
"shouldBeUnderWebView": shouldBeUnderWebView
|
|
516
|
+
]
|
|
517
|
+
|
|
518
|
+
guard let viewPositionAndSizeJSON = try? ViewPositionAndSizeJSON.fromJSONObject(jsonObject) else {
|
|
496
519
|
call.reject(CommandError.invalidJSON.toJSONString())
|
|
497
520
|
return
|
|
498
521
|
}
|
|
@@ -514,9 +537,9 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
514
537
|
}
|
|
515
538
|
}
|
|
516
539
|
|
|
517
|
-
@objc(
|
|
518
|
-
func
|
|
519
|
-
|
|
540
|
+
@objc(showBarcodeCountView:)
|
|
541
|
+
func showBarcodeCountView(_ call: CAPPluginCall) {
|
|
542
|
+
dispatchMain {
|
|
520
543
|
guard let barcodeCountView = self.barcodeCountViewHandler.barcodeCountView else {
|
|
521
544
|
call.reject(CommandError.noViewToBeShown.toJSONString())
|
|
522
545
|
return
|
|
@@ -528,10 +551,10 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
528
551
|
}
|
|
529
552
|
}
|
|
530
553
|
|
|
531
|
-
@objc(
|
|
532
|
-
func
|
|
533
|
-
|
|
534
|
-
guard let barcodeCountView = barcodeCountViewHandler.barcodeCountView else {
|
|
554
|
+
@objc(hideBarcodeCountView:)
|
|
555
|
+
func hideBarcodeCountView(_ call: CAPPluginCall) {
|
|
556
|
+
dispatchMain {
|
|
557
|
+
guard let barcodeCountView = self.barcodeCountViewHandler.barcodeCountView else {
|
|
535
558
|
call.reject(CommandError.noViewToBeHidden.toJSONString())
|
|
536
559
|
return
|
|
537
560
|
}
|
|
@@ -548,45 +571,36 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
548
571
|
call.resolve()
|
|
549
572
|
}
|
|
550
573
|
|
|
551
|
-
@objc(
|
|
552
|
-
func
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
dispatchMainSync {
|
|
558
|
-
barcodeCountModule.addViewFromJson(parent: barcodeCountViewHandler.webView,
|
|
574
|
+
@objc(createBarcodeCountView:)
|
|
575
|
+
func createBarcodeCountView(_ call: CAPPluginCall) {
|
|
576
|
+
let viewJson = call.getString("viewJson")!
|
|
577
|
+
|
|
578
|
+
dispatchMain {
|
|
579
|
+
self.barcodeCountModule.addViewFromJson(parent: self.barcodeCountViewHandler.webView,
|
|
559
580
|
viewJson: viewJson,
|
|
560
581
|
result: CapacitorResult(call))
|
|
561
|
-
barcodeCountViewHandler.barcodeCountView = barcodeCountModule.barcodeCountView
|
|
582
|
+
self.barcodeCountViewHandler.barcodeCountView = self.barcodeCountModule.barcodeCountView
|
|
562
583
|
}
|
|
563
584
|
}
|
|
564
585
|
|
|
565
|
-
@objc(
|
|
566
|
-
func
|
|
567
|
-
|
|
568
|
-
barcodeCountViewHandler.barcodeCountView = nil
|
|
569
|
-
barcodeCountModule.disposeBarcodeCountView()
|
|
586
|
+
@objc(removeBarcodeCountView:)
|
|
587
|
+
func removeBarcodeCountView(_ call: CAPPluginCall) {
|
|
588
|
+
dispatchMain {
|
|
589
|
+
self.barcodeCountViewHandler.barcodeCountView = nil
|
|
590
|
+
self.barcodeCountModule.disposeBarcodeCountView()
|
|
570
591
|
}
|
|
571
592
|
}
|
|
572
593
|
|
|
573
|
-
@objc(
|
|
574
|
-
func
|
|
575
|
-
|
|
576
|
-
let viewJson = call.getString("BarcodeCountView") else {
|
|
577
|
-
call.reject(CommandError.noBarcodeCountView.toJSONString())
|
|
578
|
-
return
|
|
579
|
-
}
|
|
594
|
+
@objc(updateBarcodeCountView:)
|
|
595
|
+
func updateBarcodeCountView(_ call: CAPPluginCall) {
|
|
596
|
+
let viewJson = call.getString("viewJson")!
|
|
580
597
|
barcodeCountModule.updateBarcodeCountView(viewJson: viewJson, result: CapacitorResult(call))
|
|
581
598
|
}
|
|
582
599
|
|
|
583
|
-
@objc(
|
|
584
|
-
func
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
return
|
|
588
|
-
}
|
|
589
|
-
barcodeCountModule.updateBarcodeCount(modeJson: modeJson, result: CapacitorResult(call))
|
|
600
|
+
@objc(updateBarcodeCountMode:)
|
|
601
|
+
func updateBarcodeCountMode(_ call: CAPPluginCall) {
|
|
602
|
+
let barcodeCountJson = call.getString("barcodeCountJson")!
|
|
603
|
+
barcodeCountModule.updateBarcodeCount(modeJson: barcodeCountJson, result: CapacitorResult(call))
|
|
590
604
|
}
|
|
591
605
|
|
|
592
606
|
@objc(resetBarcodeCountSession:)
|
|
@@ -595,14 +609,14 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
595
609
|
call.resolve()
|
|
596
610
|
}
|
|
597
611
|
|
|
598
|
-
@objc(
|
|
599
|
-
func
|
|
612
|
+
@objc(startBarcodeCountScanningPhase:)
|
|
613
|
+
func startBarcodeCountScanningPhase(_ call: CAPPluginCall) {
|
|
600
614
|
barcodeCountModule.startScanningPhase()
|
|
601
615
|
call.resolve()
|
|
602
616
|
}
|
|
603
617
|
|
|
604
|
-
@objc(
|
|
605
|
-
func
|
|
618
|
+
@objc(endBarcodeCountScanningPhase:)
|
|
619
|
+
func endBarcodeCountScanningPhase(_ call: CAPPluginCall) {
|
|
606
620
|
barcodeCountModule.endScanningPhase()
|
|
607
621
|
call.resolve()
|
|
608
622
|
}
|
|
@@ -625,107 +639,71 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
625
639
|
call.resolve()
|
|
626
640
|
}
|
|
627
641
|
|
|
628
|
-
@objc(
|
|
629
|
-
func
|
|
642
|
+
@objc(finishBarcodeCountOnScan:)
|
|
643
|
+
func finishBarcodeCountOnScan(_ call: CAPPluginCall) {
|
|
630
644
|
barcodeCountModule.finishOnScan(enabled: true)
|
|
631
645
|
call.resolve()
|
|
632
646
|
}
|
|
633
647
|
|
|
634
|
-
@objc(
|
|
635
|
-
func
|
|
636
|
-
guard let
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
648
|
+
@objc(finishBarcodeCountBrushForRecognizedBarcode:)
|
|
649
|
+
func finishBarcodeCountBrushForRecognizedBarcode(_ call: CAPPluginCall) {
|
|
650
|
+
guard let trackedBarcodeId = call.getInt("trackedBarcodeId") else {
|
|
651
|
+
call.reject("Invalid tracked barcode id received.")
|
|
652
|
+
return
|
|
653
|
+
}
|
|
654
|
+
let brushJson = call.getString("brushJson")
|
|
640
655
|
let brush = brushJson.flatMap { Brush(jsonString: $0) }
|
|
641
|
-
|
|
642
656
|
barcodeCountModule.finishBrushForRecognizedBarcodeEvent(brush: brush,
|
|
643
|
-
|
|
644
|
-
|
|
657
|
+
trackedBarcodeId: trackedBarcodeId,
|
|
658
|
+
result: CapacitorResult(call))
|
|
645
659
|
}
|
|
646
660
|
|
|
647
|
-
@objc(
|
|
648
|
-
func
|
|
649
|
-
guard let
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
661
|
+
@objc(finishBarcodeCountBrushForRecognizedBarcodeNotInList:)
|
|
662
|
+
func finishBarcodeCountBrushForRecognizedBarcodeNotInList(_ call: CAPPluginCall) {
|
|
663
|
+
guard let trackedBarcodeId = call.getInt("trackedBarcodeId") else {
|
|
664
|
+
call.reject("Invalid tracked barcode id received.")
|
|
665
|
+
return
|
|
666
|
+
}
|
|
667
|
+
let brushJson = call.getString("brushJson")
|
|
654
668
|
let brush = brushJson.flatMap { Brush(jsonString: $0) }
|
|
655
669
|
barcodeCountModule.finishBrushForRecognizedBarcodeNotInListEvent(brush: brush,
|
|
656
670
|
trackedBarcodeId: trackedBarcodeId,
|
|
657
671
|
result: CapacitorResult(call))
|
|
658
672
|
}
|
|
659
673
|
|
|
660
|
-
@objc(
|
|
661
|
-
func
|
|
662
|
-
guard let
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
674
|
+
@objc(finishBarcodeCountBrushForAcceptedBarcode:)
|
|
675
|
+
func finishBarcodeCountBrushForAcceptedBarcode(_ call: CAPPluginCall) {
|
|
676
|
+
guard let trackedBarcodeId = call.getInt("trackedBarcodeId") else {
|
|
677
|
+
call.reject("Invalid tracked barcode id received.")
|
|
678
|
+
return
|
|
679
|
+
}
|
|
680
|
+
let brushJson = call.getString("brushJson")
|
|
667
681
|
let brush = brushJson.flatMap { Brush(jsonString: $0) }
|
|
668
682
|
barcodeCountModule.finishBrushForAcceptedBarcodeEvent(brush: brush,
|
|
669
683
|
trackedBarcodeId: trackedBarcodeId)
|
|
670
684
|
call.resolve()
|
|
671
685
|
}
|
|
672
686
|
|
|
673
|
-
@objc(
|
|
674
|
-
func
|
|
675
|
-
guard let
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
687
|
+
@objc(finishBarcodeCountBrushForRejectedBarcode:)
|
|
688
|
+
func finishBarcodeCountBrushForRejectedBarcode(_ call: CAPPluginCall) {
|
|
689
|
+
guard let trackedBarcodeId = call.getInt("trackedBarcodeId") else {
|
|
690
|
+
call.reject("Invalid tracked barcode id received.")
|
|
691
|
+
return
|
|
692
|
+
}
|
|
693
|
+
let brushJson = call.getString("brushJson")
|
|
680
694
|
let brush = brushJson.flatMap { Brush(jsonString: $0) }
|
|
681
695
|
barcodeCountModule.finishBrushForRejectedBarcodeEvent(brush: brush,
|
|
682
696
|
trackedBarcodeId: trackedBarcodeId)
|
|
683
697
|
call.resolve()
|
|
684
698
|
}
|
|
685
699
|
|
|
686
|
-
@objc(
|
|
687
|
-
func
|
|
688
|
-
barcodeFindModule.setModeEnabled(enabled: call.getBool("enabled", false))
|
|
689
|
-
call.resolve()
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
@objc(setBarcodeTransformer:)
|
|
693
|
-
func setBarcodeTransformer(_ call: CAPPluginCall) {
|
|
694
|
-
barcodeFindModule.setBarcodeFindTransformer(result: CapacitorResult(call))
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
@objc(submitBarcodeFindTransformerResult:)
|
|
699
|
-
func submitBarcodeFindTransformerResult(_ call: CAPPluginCall) {
|
|
700
|
-
guard let transformedBarcode = call.getString("transformedBarcode") else {
|
|
701
|
-
call.reject(CommandError.invalidJSON.toJSONString())
|
|
702
|
-
return
|
|
703
|
-
}
|
|
704
|
-
barcodeFindModule.submitBarcodeFindTransformerResult(
|
|
705
|
-
transformedData: transformedBarcode,
|
|
706
|
-
result: CapacitorResult(call)
|
|
707
|
-
)
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
@objc(updateBarcodeFindFeedback:)
|
|
711
|
-
func updateBarcodeFindFeedback(_ call: CAPPluginCall) {
|
|
712
|
-
guard let feedbackJson = call.getString("feedbackJson") else {
|
|
713
|
-
call.reject(CommandError.invalidJSON.toJSONString())
|
|
714
|
-
return
|
|
715
|
-
}
|
|
716
|
-
barcodeFindModule.updateFeedback(
|
|
717
|
-
feedbackJson: feedbackJson,
|
|
718
|
-
result: CapacitorResult(call)
|
|
719
|
-
)
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
@objc(getSpatialMap:)
|
|
723
|
-
func getSpatialMap(_ call: CAPPluginCall) {
|
|
700
|
+
@objc(getBarcodeCountSpatialMap:)
|
|
701
|
+
func getBarcodeCountSpatialMap(_ call: CAPPluginCall) {
|
|
724
702
|
barcodeCountModule.submitSpatialMap(result: CapacitorResult(call))
|
|
725
703
|
}
|
|
726
704
|
|
|
727
|
-
@objc(
|
|
728
|
-
func
|
|
705
|
+
@objc(getBarcodeCountSpatialMapWithHints:)
|
|
706
|
+
func getBarcodeCountSpatialMapWithHints(_ call: CAPPluginCall) {
|
|
729
707
|
guard let expectedNumberOfRows = call.getInt("expectedNumberOfRows") else {
|
|
730
708
|
call.reject("expectedNumberOfRows is missing in the function parameters.")
|
|
731
709
|
return
|
|
@@ -745,7 +723,7 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
745
723
|
|
|
746
724
|
@objc(setBarcodeCountModeEnabledState:)
|
|
747
725
|
func setBarcodeCountModeEnabledState(_ call: CAPPluginCall) {
|
|
748
|
-
barcodeCountModule.setModeEnabled(enabled: call.getBool("
|
|
726
|
+
barcodeCountModule.setModeEnabled(enabled: call.getBool("isEnabled", false))
|
|
749
727
|
call.resolve()
|
|
750
728
|
}
|
|
751
729
|
|
|
@@ -785,11 +763,11 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
785
763
|
call.reject(CommandError.invalidJSON.toJSONString())
|
|
786
764
|
return
|
|
787
765
|
}
|
|
788
|
-
|
|
789
|
-
barcodeFindModule.addViewToContainer(container: barcodeFindViewHandler.webView,
|
|
766
|
+
dispatchMain {
|
|
767
|
+
self.barcodeFindModule.addViewToContainer(container: self.barcodeFindViewHandler.webView,
|
|
790
768
|
jsonString: viewJson,
|
|
791
769
|
result: CapacitorResult(call))
|
|
792
|
-
barcodeFindViewHandler.barcodeFindView = barcodeFindModule.barcodeFindView
|
|
770
|
+
self.barcodeFindViewHandler.barcodeFindView = self.barcodeFindModule.barcodeFindView
|
|
793
771
|
}
|
|
794
772
|
}
|
|
795
773
|
|
|
@@ -810,9 +788,9 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
810
788
|
|
|
811
789
|
@objc(removeFindView:)
|
|
812
790
|
func removeFindView(_ call: CAPPluginCall) {
|
|
813
|
-
|
|
814
|
-
barcodeFindViewHandler.barcodeFindView = nil
|
|
815
|
-
barcodeFindModule.removeBarcodeFindView(result: CapacitorResult(call))
|
|
791
|
+
dispatchMain {
|
|
792
|
+
self.barcodeFindViewHandler.barcodeFindView = nil
|
|
793
|
+
self.barcodeFindModule.removeBarcodeFindView(result: CapacitorResult(call))
|
|
816
794
|
}
|
|
817
795
|
}
|
|
818
796
|
|
|
@@ -843,6 +821,42 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
843
821
|
barcodeFindModule.removeBarcodeFindViewListener(result: CapacitorResult(call))
|
|
844
822
|
}
|
|
845
823
|
|
|
824
|
+
@objc(setBarcodeFindModeEnabledState:)
|
|
825
|
+
func setBarcodeFindModeEnabledState(_ call: CAPPluginCall) {
|
|
826
|
+
barcodeFindModule.setModeEnabled(enabled: call.getBool("enabled", false))
|
|
827
|
+
call.resolve()
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
@objc(setBarcodeTransformer:)
|
|
831
|
+
func setBarcodeTransformer(_ call: CAPPluginCall) {
|
|
832
|
+
barcodeFindModule.setBarcodeFindTransformer(result: CapacitorResult(call))
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
|
|
836
|
+
@objc(submitBarcodeFindTransformerResult:)
|
|
837
|
+
func submitBarcodeFindTransformerResult(_ call: CAPPluginCall) {
|
|
838
|
+
guard let transformedBarcode = call.getString("transformedBarcode") else {
|
|
839
|
+
call.reject(CommandError.invalidJSON.toJSONString())
|
|
840
|
+
return
|
|
841
|
+
}
|
|
842
|
+
barcodeFindModule.submitBarcodeFindTransformerResult(
|
|
843
|
+
transformedData: transformedBarcode,
|
|
844
|
+
result: CapacitorResult(call)
|
|
845
|
+
)
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
@objc(updateBarcodeFindFeedback:)
|
|
849
|
+
func updateBarcodeFindFeedback(_ call: CAPPluginCall) {
|
|
850
|
+
guard let feedbackJson = call.getString("feedbackJson") else {
|
|
851
|
+
call.reject(CommandError.invalidJSON.toJSONString())
|
|
852
|
+
return
|
|
853
|
+
}
|
|
854
|
+
barcodeFindModule.updateFeedback(
|
|
855
|
+
feedbackJson: feedbackJson,
|
|
856
|
+
result: CapacitorResult(call)
|
|
857
|
+
)
|
|
858
|
+
}
|
|
859
|
+
|
|
846
860
|
@objc(barcodeFindViewOnPause:)
|
|
847
861
|
func barcodeFindViewOnPause(_ call: CAPPluginCall) {
|
|
848
862
|
// No iOS implementation
|
|
@@ -892,7 +906,7 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
892
906
|
|
|
893
907
|
@objc(showFindView:)
|
|
894
908
|
func showFindView(_ call: CAPPluginCall) {
|
|
895
|
-
|
|
909
|
+
dispatchMain {
|
|
896
910
|
guard let barcodeFindView = self.barcodeFindViewHandler.barcodeFindView else {
|
|
897
911
|
call.reject(CommandError.noViewToBeShown.toJSONString())
|
|
898
912
|
return
|
|
@@ -904,7 +918,7 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
904
918
|
|
|
905
919
|
@objc(hideFindView:)
|
|
906
920
|
func hideFindView(_ call: CAPPluginCall) {
|
|
907
|
-
|
|
921
|
+
dispatchMain {
|
|
908
922
|
guard let barcodeFindView = self.barcodeFindViewHandler.barcodeFindView else {
|
|
909
923
|
call.reject(CommandError.noViewToBeShown.toJSONString())
|
|
910
924
|
return
|
|
@@ -922,7 +936,7 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
922
936
|
call.reject(CommandError.invalidJSON.toJSONString())
|
|
923
937
|
return
|
|
924
938
|
}
|
|
925
|
-
|
|
939
|
+
dispatchMain {
|
|
926
940
|
self.barcodePickModule.addViewToContainer(container: self.barcodePickViewHandler.webView,
|
|
927
941
|
jsonString: viewJson,
|
|
928
942
|
result: CapacitorResult(call))
|
|
@@ -932,9 +946,9 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
932
946
|
|
|
933
947
|
@objc(removePickView:)
|
|
934
948
|
func removePickView(_ call: CAPPluginCall) {
|
|
935
|
-
|
|
936
|
-
barcodePickViewHandler.barcodePickView = nil
|
|
937
|
-
barcodePickModule.removeBarcodePickView(result: CapacitorResult(call))
|
|
949
|
+
dispatchMain {
|
|
950
|
+
self.barcodePickViewHandler.barcodePickView = nil
|
|
951
|
+
self.barcodePickModule.removeBarcodePickView(result: CapacitorResult(call))
|
|
938
952
|
}
|
|
939
953
|
}
|
|
940
954
|
|
|
@@ -948,7 +962,7 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
948
962
|
|
|
949
963
|
@objc(setPickViewPositionAndSize:)
|
|
950
964
|
func setPickViewPositionAndSize(_ call: CAPPluginCall) {
|
|
951
|
-
|
|
965
|
+
dispatchMain {
|
|
952
966
|
let jsonObject = call.getObject("position")
|
|
953
967
|
guard let viewPositionAndSizeJSON = try? ViewPositionAndSizeJSON.fromJSONObject(jsonObject as Any) else {
|
|
954
968
|
call.reject(CommandError.invalidJSON.toJSONString())
|
|
@@ -1168,8 +1182,8 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
1168
1182
|
call.reject(CommandError.invalidJSON.toJSONString())
|
|
1169
1183
|
return
|
|
1170
1184
|
}
|
|
1171
|
-
|
|
1172
|
-
sparkScanModule.addViewToContainer(
|
|
1185
|
+
dispatchMain {
|
|
1186
|
+
self.sparkScanModule.addViewToContainer(
|
|
1173
1187
|
container,
|
|
1174
1188
|
jsonString: viewJson,
|
|
1175
1189
|
result: CapacitorResult(call)
|
|
@@ -1179,8 +1193,8 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
1179
1193
|
|
|
1180
1194
|
@objc(disposeSparkScanView:)
|
|
1181
1195
|
func disposeSparkScanView(_ call: CAPPluginCall) {
|
|
1182
|
-
|
|
1183
|
-
sparkScanModule.disposeView()
|
|
1196
|
+
dispatchMain {
|
|
1197
|
+
self.sparkScanModule.disposeView()
|
|
1184
1198
|
}
|
|
1185
1199
|
call.resolve()
|
|
1186
1200
|
}
|
|
@@ -1191,8 +1205,8 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
1191
1205
|
call.reject(CommandError.invalidJSON.toJSONString())
|
|
1192
1206
|
return
|
|
1193
1207
|
}
|
|
1194
|
-
|
|
1195
|
-
sparkScanModule.updateView(viewJson: viewJson, result: CapacitorResult(call))
|
|
1208
|
+
dispatchMain {
|
|
1209
|
+
self.sparkScanModule.updateView(viewJson: viewJson, result: CapacitorResult(call))
|
|
1196
1210
|
}
|
|
1197
1211
|
}
|
|
1198
1212
|
|
|
@@ -1207,15 +1221,15 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
1207
1221
|
|
|
1208
1222
|
@objc(showSparkScanView:)
|
|
1209
1223
|
func showSparkScanView(_ call: CAPPluginCall) {
|
|
1210
|
-
|
|
1211
|
-
sparkScanModule.sparkScanView?.isHidden = false
|
|
1224
|
+
dispatchMain {
|
|
1225
|
+
self.sparkScanModule.sparkScanView?.isHidden = false
|
|
1212
1226
|
}
|
|
1213
1227
|
}
|
|
1214
1228
|
|
|
1215
1229
|
@objc(hideSparkScanView:)
|
|
1216
1230
|
func hideSparkScanView(_ call: CAPPluginCall) {
|
|
1217
|
-
|
|
1218
|
-
sparkScanModule.sparkScanView?.isHidden = true
|
|
1231
|
+
dispatchMain {
|
|
1232
|
+
self.sparkScanModule.sparkScanView?.isHidden = true
|
|
1219
1233
|
}
|
|
1220
1234
|
}
|
|
1221
1235
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scandit-capacitor-datacapture-barcode",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0-beta.2",
|
|
4
4
|
"description": "Scandit Data Capture SDK for Capacitor",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"private": false,
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"watch": "tsc --watch"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"scandit-capacitor-datacapture-core": "7.
|
|
27
|
-
"scandit-datacapture-frameworks-barcode": "7.
|
|
28
|
-
"scandit-datacapture-frameworks-core": "7.
|
|
26
|
+
"scandit-capacitor-datacapture-core": "7.2.0-beta.2",
|
|
27
|
+
"scandit-datacapture-frameworks-barcode": "7.2.0-beta.2",
|
|
28
|
+
"scandit-datacapture-frameworks-core": "7.2.0-beta.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
"@capacitor/android": "^6.0.0",
|
|
36
36
|
"@capacitor/core": "^6.0.0",
|
|
37
37
|
"@capacitor/ios": "^6.0.0",
|
|
38
|
-
"@ionic/prettier-config": "^
|
|
38
|
+
"@ionic/prettier-config": "^1.0.0",
|
|
39
|
+
"@ionic/swiftlint-config": "^1.0.0",
|
|
39
40
|
"@jest/globals": "^29.7.0",
|
|
40
41
|
"@rollup/plugin-commonjs": "24.1.0",
|
|
41
42
|
"@rollup/plugin-node-resolve": "15.0.2",
|
|
@@ -47,10 +48,12 @@
|
|
|
47
48
|
"eslint": "8.37.0",
|
|
48
49
|
"jest": "^29.7.0",
|
|
49
50
|
"jest-environment-jsdom": "^29.7.0",
|
|
50
|
-
"prettier": "^
|
|
51
|
+
"prettier": "^2.0.5",
|
|
52
|
+
"prettier-plugin-java": "^2.0.0",
|
|
51
53
|
"rimraf": "4.4.0",
|
|
52
54
|
"rollup": "3.25.1",
|
|
53
55
|
"rollup-plugin-modify": "3.0.0",
|
|
56
|
+
"swiftlint": "^1.0.1",
|
|
54
57
|
"ts-jest": "^29.1.2",
|
|
55
58
|
"typescript": "4.9.5"
|
|
56
59
|
},
|
|
@@ -68,5 +71,6 @@
|
|
|
68
71
|
"src": "android"
|
|
69
72
|
}
|
|
70
73
|
},
|
|
71
|
-
"prettier": "@ionic/prettier-config"
|
|
74
|
+
"prettier": "@ionic/prettier-config",
|
|
75
|
+
"swiftlint": "@ionic/swiftlint-config"
|
|
72
76
|
}
|