scandit-capacitor-datacapture-barcode 7.4.0-beta.1 → 7.4.0

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.
@@ -17,5 +17,5 @@ Pod::Spec.new do |s|
17
17
 
18
18
  s.dependency "Capacitor"
19
19
  s.dependency "ScanditCapacitorDatacaptureCore", "= #{version}"
20
- s.dependency "scandit-datacapture-frameworks-barcode", '= 7.4.0-beta.1'
20
+ s.dependency "scandit-datacapture-frameworks-barcode", '= 7.4.0'
21
21
  end
@@ -89,7 +89,7 @@ repositories {
89
89
  }
90
90
 
91
91
  dependencies {
92
- def sdk_version = "7.4.0-beta.1"
92
+ def sdk_version = "7.4.0"
93
93
 
94
94
  implementation fileTree(dir: 'libs', include: ['*.jar'])
95
95
  implementation fileTree(dir: 'library', include: ['*.aar'])
package/dist/barcode.js CHANGED
@@ -2820,25 +2820,8 @@ class BarcodeCaptureListenerController extends BaseNewController {
2820
2820
  }
2821
2821
  constructor() {
2822
2822
  super('BarcodeCaptureListenerProxy');
2823
- }
2824
- reset() {
2825
- return this._proxy.$resetBarcodeCaptureSession();
2826
- }
2827
- setModeEnabledState(enabled) {
2828
- this._proxy.$setBarcodeCaptureModeEnabledState({ enabled: enabled });
2829
- }
2830
- updateBarcodeCaptureMode() {
2831
- return this._proxy.$updateBarcodeCaptureMode({ modeJson: JSON.stringify(this.barcodeCapture.toJSON()) });
2832
- }
2833
- applyBarcodeCaptureModeSettings(newSettings) {
2834
- return this._proxy.$applyBarcodeCaptureModeSettings({ modeSettingsJson: JSON.stringify(newSettings.toJSON()) });
2835
- }
2836
- updateBarcodeCaptureOverlay(overlay) {
2837
- return this._proxy.$updateBarcodeCaptureOverlay({ overlayJson: JSON.stringify(overlay.toJSON()) });
2838
- }
2839
- subscribeListener() {
2840
- this._proxy.$registerBarcodeCaptureListenerForEvents();
2841
- this._proxy.on$didUpdateSession = (ev) => __awaiter(this, void 0, void 0, function* () {
2823
+ this.isListeningForEvents = false;
2824
+ this.handleDidUpdateSession = (ev) => __awaiter(this, void 0, void 0, function* () {
2842
2825
  const payload = EventDataParser.parse(ev.data);
2843
2826
  if (payload === null) {
2844
2827
  console.error('BarcodeCaptureListenerController.subscribeListener: didUpdateSession payload is null');
@@ -2848,7 +2831,7 @@ class BarcodeCaptureListenerController extends BaseNewController {
2848
2831
  yield this.notifyListenersOfDidUpdateSession(session);
2849
2832
  this._proxy.$finishBarcodeCaptureDidUpdateSession({ enabled: this.barcodeCapture.isEnabled });
2850
2833
  });
2851
- this._proxy.on$didScan = (ev) => __awaiter(this, void 0, void 0, function* () {
2834
+ this.handleDidScan = (ev) => __awaiter(this, void 0, void 0, function* () {
2852
2835
  const payload = EventDataParser.parse(ev.data);
2853
2836
  if (payload === null) {
2854
2837
  console.error('BarcodeCaptureListenerController.subscribeListener: didScan payload is null');
@@ -2859,8 +2842,43 @@ class BarcodeCaptureListenerController extends BaseNewController {
2859
2842
  this._proxy.$finishBarcodeCaptureDidScan({ enabled: this.barcodeCapture.isEnabled });
2860
2843
  });
2861
2844
  }
2845
+ reset() {
2846
+ return this._proxy.$resetBarcodeCaptureSession();
2847
+ }
2848
+ setModeEnabledState(enabled) {
2849
+ this._proxy.$setBarcodeCaptureModeEnabledState({ enabled: enabled });
2850
+ }
2851
+ updateBarcodeCaptureMode() {
2852
+ return this._proxy.$updateBarcodeCaptureMode({ modeJson: JSON.stringify(this.barcodeCapture.toJSON()) });
2853
+ }
2854
+ applyBarcodeCaptureModeSettings(newSettings) {
2855
+ return this._proxy.$applyBarcodeCaptureModeSettings({ modeSettingsJson: JSON.stringify(newSettings.toJSON()) });
2856
+ }
2857
+ updateBarcodeCaptureOverlay(overlay) {
2858
+ return this._proxy.$updateBarcodeCaptureOverlay({ overlayJson: JSON.stringify(overlay.toJSON()) });
2859
+ }
2860
+ subscribeListener() {
2861
+ if (this.isListeningForEvents) {
2862
+ return;
2863
+ }
2864
+ this._proxy.subscribeForEvents(Object.values(BarcodeCaptureListenerEvents));
2865
+ this._proxy.$registerBarcodeCaptureListenerForEvents();
2866
+ this._proxy.eventEmitter.on(BarcodeCaptureListenerEvents.didUpdateSession, this.handleDidUpdateSession);
2867
+ this._proxy.eventEmitter.on(BarcodeCaptureListenerEvents.didScan, this.handleDidScan);
2868
+ this.isListeningForEvents = true;
2869
+ }
2862
2870
  unsubscribeListener() {
2871
+ if (!this.isListeningForEvents) {
2872
+ return;
2873
+ }
2863
2874
  this._proxy.$unregisterBarcodeCaptureListenerForEvents();
2875
+ this._proxy.unsubscribeFromEvents(Object.values(BarcodeCaptureListenerEvents));
2876
+ this._proxy.eventEmitter.off(BarcodeCaptureListenerEvents.didUpdateSession, this.handleDidUpdateSession);
2877
+ this._proxy.eventEmitter.off(BarcodeCaptureListenerEvents.didScan, this.handleDidScan);
2878
+ this.isListeningForEvents = false;
2879
+ }
2880
+ dispose() {
2881
+ this.unsubscribeListener();
2864
2882
  this._proxy.dispose();
2865
2883
  }
2866
2884
  notifyListenersOfDidUpdateSession(session) {