scandit-capacitor-datacapture-label 8.5.0-beta.1 → 8.5.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.
@@ -18,5 +18,5 @@ Pod::Spec.new do |s|
18
18
  s.dependency "Capacitor"
19
19
  s.dependency "ScanditCapacitorDatacaptureCore", "= #{version}"
20
20
  s.dependency "ScanditCapacitorDatacaptureBarcode", "= #{version}"
21
- s.dependency "scandit-datacapture-frameworks-label", '= 8.5.0-beta.1'
21
+ s.dependency "scandit-datacapture-frameworks-label", '= 8.5.0'
22
22
  end
@@ -143,7 +143,7 @@ if (ext.has('repos')) {
143
143
  }
144
144
 
145
145
  dependencies {
146
- def sdk_version = "8.5.0-beta.1"
146
+ def sdk_version = "8.5.0"
147
147
 
148
148
  implementation fileTree(dir: 'libs', include: ['*.jar'])
149
149
  implementation fileTree(dir: 'library', include: ['*.aar'])
package/dist/index.js CHANGED
@@ -1402,6 +1402,8 @@ class LabelCaptureAdvancedOverlayController extends BaseController {
1402
1402
  super('LabelCaptureAdvancedOverlayProxy');
1403
1403
  this.hasListeners = false;
1404
1404
  this.hasPendingListenerRegistration = false;
1405
+ // viewId the native listener is registered against (-1 = none); re-register on view change. [SDC-30872]
1406
+ this.registeredViewId = -1;
1405
1407
  // Arrow function wrappers to avoid .bind(this) and always use current class state
1406
1408
  this.handleViewForLabelWrapper = (ev) => __awaiter(this, void 0, void 0, function* () {
1407
1409
  return this.handleViewForLabel(ev);
@@ -1477,19 +1479,31 @@ class LabelCaptureAdvancedOverlayController extends BaseController {
1477
1479
  this._proxy.eventEmitter.on(LabelCaptureAdvancedOverlayListenerEvents.anchorForCapturedLabelField, this.handleAnchorForCapturedLabelFieldWrapper);
1478
1480
  this._proxy.eventEmitter.on(LabelCaptureAdvancedOverlayListenerEvents.offsetForCapturedLabelField, this.handleOffsetForCapturedLabelFieldWrapper);
1479
1481
  this.hasListeners = true;
1480
- if (this.dataCaptureViewId !== -1) {
1481
- yield this.adapter.addLabelCaptureAdvancedOverlayListener({ dataCaptureViewId: this.dataCaptureViewId });
1482
- }
1483
- else {
1482
+ yield this.registerListenerForCurrentView();
1483
+ });
1484
+ }
1485
+ // (Re)register the native listener whenever the viewId changes; the view can be recreated
1486
+ // after the listener is set, and on iOS registering against a stale/-1 viewId silently
1487
+ // no-ops, leaving the overlay delegate unwired. [SDC-30872]
1488
+ registerListenerForCurrentView() {
1489
+ return __awaiter(this, void 0, void 0, function* () {
1490
+ const viewId = this.dataCaptureViewId;
1491
+ if (viewId === -1) {
1484
1492
  this.hasPendingListenerRegistration = true;
1493
+ return;
1485
1494
  }
1495
+ if (this.registeredViewId === viewId) {
1496
+ return;
1497
+ }
1498
+ this.hasPendingListenerRegistration = false;
1499
+ this.registeredViewId = viewId;
1500
+ yield this.adapter.addLabelCaptureAdvancedOverlayListener({ dataCaptureViewId: viewId });
1486
1501
  });
1487
1502
  }
1488
1503
  onViewChanged() {
1489
1504
  return __awaiter(this, void 0, void 0, function* () {
1490
- if (this.hasPendingListenerRegistration && this.dataCaptureViewId !== -1) {
1491
- this.hasPendingListenerRegistration = false;
1492
- yield this.adapter.addLabelCaptureAdvancedOverlayListener({ dataCaptureViewId: this.dataCaptureViewId });
1505
+ if (this.hasListeners) {
1506
+ yield this.registerListenerForCurrentView();
1493
1507
  }
1494
1508
  });
1495
1509
  }
@@ -1498,8 +1512,9 @@ class LabelCaptureAdvancedOverlayController extends BaseController {
1498
1512
  if (!this.hasListeners) {
1499
1513
  return;
1500
1514
  }
1501
- if (this.dataCaptureViewId !== -1) {
1502
- yield this.adapter.removeLabelCaptureAdvancedOverlayListener({ dataCaptureViewId: this.dataCaptureViewId });
1515
+ if (this.registeredViewId !== -1) {
1516
+ yield this.adapter.removeLabelCaptureAdvancedOverlayListener({ dataCaptureViewId: this.registeredViewId });
1517
+ this.registeredViewId = -1;
1503
1518
  }
1504
1519
  this._proxy.unsubscribeFromEvents(Object.values(LabelCaptureAdvancedOverlayListenerEvents));
1505
1520
  this._proxy.eventEmitter.off(LabelCaptureAdvancedOverlayListenerEvents.viewForLabel, this.handleViewForLabelWrapper);
@@ -2442,6 +2457,8 @@ class LabelCaptureBasicOverlayController extends BaseController {
2442
2457
  super('LabelCaptureBasicOverlayProxy');
2443
2458
  this.hasListeners = false;
2444
2459
  this.hasPendingListenerRegistration = false;
2460
+ // viewId the native listener is registered against (-1 = none); re-register on view change. [SDC-30872]
2461
+ this.registeredViewId = -1;
2445
2462
  // Arrow function wrappers to avoid .bind(this) and always use current class state
2446
2463
  this.handleBrushForFieldOfLabelWrapper = (ev) => __awaiter(this, void 0, void 0, function* () {
2447
2464
  return this.handleBrushForFieldOfLabel(ev);
@@ -2481,19 +2498,31 @@ class LabelCaptureBasicOverlayController extends BaseController {
2481
2498
  this._proxy.eventEmitter.on(LabelCaptureBasicOverlayListenerEvents.brushForLabel, this.handleBrushForLabelWrapper);
2482
2499
  this._proxy.eventEmitter.on(LabelCaptureBasicOverlayListenerEvents.didTapLabel, this.handleDidTapLabelWrapper);
2483
2500
  this.hasListeners = true;
2484
- if (this.dataCaptureViewId !== -1) {
2485
- yield this.adapter.addLabelCaptureBasicOverlayListener({ dataCaptureViewId: this.dataCaptureViewId });
2486
- }
2487
- else {
2501
+ yield this.registerListenerForCurrentView();
2502
+ });
2503
+ }
2504
+ // (Re)register the native listener whenever the viewId changes; the view can be recreated
2505
+ // after the listener is set, and on iOS registering against a stale/-1 viewId silently
2506
+ // no-ops, leaving the overlay delegate unwired. [SDC-30872]
2507
+ registerListenerForCurrentView() {
2508
+ return __awaiter(this, void 0, void 0, function* () {
2509
+ const viewId = this.dataCaptureViewId;
2510
+ if (viewId === -1) {
2488
2511
  this.hasPendingListenerRegistration = true;
2512
+ return;
2513
+ }
2514
+ if (this.registeredViewId === viewId) {
2515
+ return;
2489
2516
  }
2517
+ this.hasPendingListenerRegistration = false;
2518
+ this.registeredViewId = viewId;
2519
+ yield this.adapter.addLabelCaptureBasicOverlayListener({ dataCaptureViewId: viewId });
2490
2520
  });
2491
2521
  }
2492
2522
  onViewChanged() {
2493
2523
  return __awaiter(this, void 0, void 0, function* () {
2494
- if (this.hasPendingListenerRegistration && this.dataCaptureViewId !== -1) {
2495
- this.hasPendingListenerRegistration = false;
2496
- yield this.adapter.addLabelCaptureBasicOverlayListener({ dataCaptureViewId: this.dataCaptureViewId });
2524
+ if (this.hasListeners) {
2525
+ yield this.registerListenerForCurrentView();
2497
2526
  }
2498
2527
  });
2499
2528
  }
@@ -2502,8 +2531,9 @@ class LabelCaptureBasicOverlayController extends BaseController {
2502
2531
  if (!this.hasListeners) {
2503
2532
  return;
2504
2533
  }
2505
- if (this.dataCaptureViewId !== -1) {
2506
- yield this.adapter.removeLabelCaptureBasicOverlayListener({ dataCaptureViewId: this.dataCaptureViewId });
2534
+ if (this.registeredViewId !== -1) {
2535
+ yield this.adapter.removeLabelCaptureBasicOverlayListener({ dataCaptureViewId: this.registeredViewId });
2536
+ this.registeredViewId = -1;
2507
2537
  }
2508
2538
  this._proxy.unsubscribeFromEvents(Object.values(LabelCaptureBasicOverlayListenerEvents));
2509
2539
  this._proxy.eventEmitter.off(LabelCaptureBasicOverlayListenerEvents.brushForFieldOfLabel, this.handleBrushForFieldOfLabelWrapper);
@@ -2740,6 +2770,9 @@ class LabelCaptureValidationFlowOverlayController extends BaseController {
2740
2770
  super('LabelCaptureValidationFlowOverlayProxy');
2741
2771
  this.isSubscribed = false;
2742
2772
  this.hasPendingListenerRegistration = false;
2773
+ // viewId the native listener is currently registered against (-1 = none). Tracked so we
2774
+ // can re-register when the view is (re)created with a new id. [SDC-30872]
2775
+ this.registeredViewId = -1;
2743
2776
  // Arrow function wrapper to avoid .bind(this) and always use current class state
2744
2777
  this.handleDidCaptureLabelWithFieldsEventWrapper = (ev) => {
2745
2778
  this.handleDidCaptureLabelWithFieldsEvent(ev);
@@ -2773,19 +2806,33 @@ class LabelCaptureValidationFlowOverlayController extends BaseController {
2773
2806
  this._proxy.eventEmitter.on(LabelCaptureValidationFlowListenerEvents.didSubmitManualInputForField, this.handleDidSubmitManualInputForFieldEventWrapper);
2774
2807
  this._proxy.eventEmitter.on(LabelCaptureValidationFlowListenerEvents.didUpdateValidationFlowResult, this.handleDidUpdateValidationFlowResultEventWrapper);
2775
2808
  this.isSubscribed = true;
2776
- if (this.dataCaptureViewId !== -1) {
2777
- yield this.adapter.registerListenerForValidationFlowEvents({ dataCaptureViewId: this.dataCaptureViewId });
2778
- }
2779
- else {
2809
+ yield this.registerListenerForCurrentView();
2810
+ });
2811
+ }
2812
+ // Registers the native validation-flow listener for the current view, (re)wiring it whenever
2813
+ // the viewId changes. The view can be (re)created after the listener is set — and on iOS the
2814
+ // native register call silently no-ops when it can't resolve the view (e.g. viewId === -1),
2815
+ // leaving the overlay delegate unset so didCaptureLabelWithFields never fires. Re-registering
2816
+ // on every valid viewId change keeps the delegate wired across view recreation. [SDC-30872]
2817
+ registerListenerForCurrentView() {
2818
+ return __awaiter(this, void 0, void 0, function* () {
2819
+ const viewId = this.dataCaptureViewId;
2820
+ if (viewId === -1) {
2780
2821
  this.hasPendingListenerRegistration = true;
2822
+ return;
2823
+ }
2824
+ if (this.registeredViewId === viewId) {
2825
+ return;
2781
2826
  }
2827
+ this.hasPendingListenerRegistration = false;
2828
+ this.registeredViewId = viewId;
2829
+ yield this.adapter.registerListenerForValidationFlowEvents({ dataCaptureViewId: viewId });
2782
2830
  });
2783
2831
  }
2784
2832
  onViewChanged() {
2785
2833
  return __awaiter(this, void 0, void 0, function* () {
2786
- if (this.hasPendingListenerRegistration && this.dataCaptureViewId !== -1) {
2787
- this.hasPendingListenerRegistration = false;
2788
- yield this.adapter.registerListenerForValidationFlowEvents({ dataCaptureViewId: this.dataCaptureViewId });
2834
+ if (this.isSubscribed) {
2835
+ yield this.registerListenerForCurrentView();
2789
2836
  }
2790
2837
  });
2791
2838
  }
@@ -2794,8 +2841,9 @@ class LabelCaptureValidationFlowOverlayController extends BaseController {
2794
2841
  if (!this.isSubscribed) {
2795
2842
  return;
2796
2843
  }
2797
- if (this.dataCaptureViewId !== -1) {
2798
- yield this.adapter.unregisterListenerForValidationFlowEvents({ dataCaptureViewId: this.dataCaptureViewId });
2844
+ if (this.registeredViewId !== -1) {
2845
+ yield this.adapter.unregisterListenerForValidationFlowEvents({ dataCaptureViewId: this.registeredViewId });
2846
+ this.registeredViewId = -1;
2799
2847
  }
2800
2848
  this._proxy.eventEmitter.off(LabelCaptureValidationFlowListenerEvents.didCaptureLabelWithFields, this.handleDidCaptureLabelWithFieldsEventWrapper);
2801
2849
  this._proxy.eventEmitter.off(LabelCaptureValidationFlowListenerEvents.didSubmitManualInputForField, this.handleDidSubmitManualInputForFieldEventWrapper);
@@ -2922,11 +2970,14 @@ class LabelCaptureValidationFlowOverlay extends DefaultSerializeable {
2922
2970
  var _a, _b;
2923
2971
  this.hasListener = listener != null;
2924
2972
  this._listener = listener;
2925
- if (listener == null) {
2926
- void ((_a = this.controller) === null || _a === void 0 ? void 0 : _a.unsubscribeLabelCaptureValidationFlowListener());
2973
+ // Note: subscribe when a listener is set, unsubscribe when cleared. The previous
2974
+ // `else if (this.listener == null)` guard was dead code (this._listener was already
2975
+ // assigned above), so setting a listener never subscribed here. [SDC-30872]
2976
+ if (listener != null) {
2977
+ void ((_a = this.controller) === null || _a === void 0 ? void 0 : _a.subscribeLabelCaptureValidationFlowListener());
2927
2978
  }
2928
- else if (this.listener == null) {
2929
- void ((_b = this.controller) === null || _b === void 0 ? void 0 : _b.subscribeLabelCaptureValidationFlowListener());
2979
+ else {
2980
+ void ((_b = this.controller) === null || _b === void 0 ? void 0 : _b.unsubscribeLabelCaptureValidationFlowListener());
2930
2981
  }
2931
2982
  }
2932
2983
  applySettings(settings) {
@@ -3140,6 +3191,8 @@ class LabelCaptureAdaptiveRecognitionOverlayController extends BaseController {
3140
3191
  super('LabelCaptureAdaptiveRecognitionOverlayProxy');
3141
3192
  this.hasListeners = false;
3142
3193
  this.hasPendingListenerRegistration = false;
3194
+ // viewId the native listener is registered against (-1 = none); re-register on view change. [SDC-30872]
3195
+ this.registeredViewId = -1;
3143
3196
  this.handleRecognizedWrapper = (ev) => {
3144
3197
  this.handleRecognized(ev);
3145
3198
  };
@@ -3159,23 +3212,31 @@ class LabelCaptureAdaptiveRecognitionOverlayController extends BaseController {
3159
3212
  this._proxy.eventEmitter.on(LabelCaptureAdaptiveRecognitionListenerEvents.recognized, this.handleRecognizedWrapper);
3160
3213
  this._proxy.eventEmitter.on(LabelCaptureAdaptiveRecognitionListenerEvents.failure, this.handleFailureWrapper);
3161
3214
  this.hasListeners = true;
3162
- if (this.dataCaptureViewId !== -1) {
3163
- yield this.adapter.registerListenerForAdaptiveRecognitionOverlayEvents({
3164
- dataCaptureViewId: this.dataCaptureViewId,
3165
- });
3166
- }
3167
- else {
3215
+ yield this.registerListenerForCurrentView();
3216
+ });
3217
+ }
3218
+ // (Re)register the native listener whenever the viewId changes; the view can be recreated
3219
+ // after the listener is set, and on iOS registering against a stale/-1 viewId silently
3220
+ // no-ops, leaving the overlay delegate unwired. [SDC-30872]
3221
+ registerListenerForCurrentView() {
3222
+ return __awaiter(this, void 0, void 0, function* () {
3223
+ const viewId = this.dataCaptureViewId;
3224
+ if (viewId === -1) {
3168
3225
  this.hasPendingListenerRegistration = true;
3226
+ return;
3169
3227
  }
3228
+ if (this.registeredViewId === viewId) {
3229
+ return;
3230
+ }
3231
+ this.hasPendingListenerRegistration = false;
3232
+ this.registeredViewId = viewId;
3233
+ yield this.adapter.registerListenerForAdaptiveRecognitionOverlayEvents({ dataCaptureViewId: viewId });
3170
3234
  });
3171
3235
  }
3172
3236
  onViewChanged() {
3173
3237
  return __awaiter(this, void 0, void 0, function* () {
3174
- if (this.hasPendingListenerRegistration && this.dataCaptureViewId !== -1) {
3175
- this.hasPendingListenerRegistration = false;
3176
- yield this.adapter.registerListenerForAdaptiveRecognitionOverlayEvents({
3177
- dataCaptureViewId: this.dataCaptureViewId,
3178
- });
3238
+ if (this.hasListeners) {
3239
+ yield this.registerListenerForCurrentView();
3179
3240
  }
3180
3241
  });
3181
3242
  }
@@ -3184,10 +3245,11 @@ class LabelCaptureAdaptiveRecognitionOverlayController extends BaseController {
3184
3245
  if (!this.hasListeners) {
3185
3246
  return;
3186
3247
  }
3187
- if (this.dataCaptureViewId !== -1) {
3248
+ if (this.registeredViewId !== -1) {
3188
3249
  yield this.adapter.unregisterListenerForAdaptiveRecognitionOverlayEvents({
3189
- dataCaptureViewId: this.dataCaptureViewId,
3250
+ dataCaptureViewId: this.registeredViewId,
3190
3251
  });
3252
+ this.registeredViewId = -1;
3191
3253
  }
3192
3254
  this._proxy.unsubscribeFromEvents(Object.values(LabelCaptureAdaptiveRecognitionListenerEvents));
3193
3255
  this._proxy.eventEmitter.off(LabelCaptureAdaptiveRecognitionListenerEvents.recognized, this.handleRecognizedWrapper);