@capgo/capacitor-document-scanner 8.4.3 → 8.4.4

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.
@@ -65,7 +65,7 @@ public class DocumentScannerPlugin extends Plugin {
65
65
 
66
66
  private static class PendingScan {
67
67
 
68
- private final String callId;
68
+ private final PluginCall call;
69
69
  private final String responseType;
70
70
  private final int quality;
71
71
  private final float brightness;
@@ -76,7 +76,7 @@ public class DocumentScannerPlugin extends Plugin {
76
76
  private final List<File> acceptedPageFiles = new ArrayList<>();
77
77
 
78
78
  PendingScan(
79
- String callId,
79
+ PluginCall call,
80
80
  String responseType,
81
81
  int quality,
82
82
  float brightness,
@@ -85,7 +85,7 @@ public class DocumentScannerPlugin extends Plugin {
85
85
  int scannerMode,
86
86
  boolean reviewCapturedDocument
87
87
  ) {
88
- this.callId = callId;
88
+ this.call = call;
89
89
  this.responseType = responseType;
90
90
  this.quality = quality;
91
91
  this.brightness = brightness;
@@ -160,9 +160,9 @@ public class DocumentScannerPlugin extends Plugin {
160
160
  // Respect scannerMode as-is; do not upgrade to FULL for letUserAdjustCrop.
161
161
  int mlKitScannerMode = determineScannerMode(scannerMode);
162
162
 
163
- bridge.saveCall(call);
163
+ call.setKeepAlive(true);
164
164
  pendingScan = new PendingScan(
165
- call.getCallbackId(),
165
+ call,
166
166
  responseType,
167
167
  quality,
168
168
  brightness,
@@ -247,7 +247,7 @@ public class DocumentScannerPlugin extends Plugin {
247
247
  savedCall.reject("Unable to start document scanner: " + e.getLocalizedMessage(), e);
248
248
  releasePendingCall(savedCall);
249
249
  } else {
250
- bridge.releaseCall(call);
250
+ call.release(bridge);
251
251
  pendingScan = null;
252
252
  call.reject("Unable to start document scanner: " + e.getLocalizedMessage(), e);
253
253
  }
@@ -643,12 +643,12 @@ public class DocumentScannerPlugin extends Plugin {
643
643
  if (pendingScan == null) {
644
644
  return null;
645
645
  }
646
- return bridge.getSavedCall(pendingScan.callId);
646
+ return pendingScan.call;
647
647
  }
648
648
 
649
649
  private void releasePendingCall(PluginCall call) {
650
650
  if (pendingScan != null) {
651
- bridge.releaseCall(call);
651
+ call.release(bridge);
652
652
  pendingScan = null;
653
653
  }
654
654
  }
@@ -3,7 +3,7 @@ import Foundation
3
3
 
4
4
  @objc(DocumentScannerPlugin)
5
5
  public class DocumentScannerPlugin: CAPPlugin, CAPBridgedPlugin {
6
- private let pluginVersion: String = "8.4.3"
6
+ private let pluginVersion: String = "8.4.4"
7
7
  public let identifier = "DocumentScannerPlugin"
8
8
  public let jsName = "DocumentScanner"
9
9
  public let pluginMethods: [CAPPluginMethod] = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-document-scanner",
3
- "version": "8.4.3",
3
+ "version": "8.4.4",
4
4
  "description": "Capacitor plugin to scan document iOS and Android",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -48,6 +48,7 @@
48
48
  "watch": "tsc --watch",
49
49
  "prepublishOnly": "bun run build",
50
50
  "check:wiring": "node scripts/check-capacitor-plugin-wiring.mjs",
51
+ "check:cap9-deprecated": "node scripts/check-cap9-deprecated.mjs",
51
52
  "example:install": "cd example-app && bun install --frozen-lockfile",
52
53
  "example:build": "bun run build && cd example-app && bun install --frozen-lockfile && bun run build",
53
54
  "changelog:ai": "node scripts/generate-ai-changelog.mjs"