scandit-capacitor-datacapture-barcode 6.28.1 → 7.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.
Files changed (26) hide show
  1. package/ScanditCapacitorDatacaptureBarcode.podspec +2 -2
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/com/scandit/capacitor/datacapture/barcode/ScanditBarcodeNative.kt +114 -57
  4. package/dist/barcode.js +562 -657
  5. package/dist/barcode.js.map +1 -1
  6. package/dist/dts/definitions.d.ts +13 -11
  7. package/dist/dts/ts/{BarcodeTrackingAdvancedOverlay.d.ts → BarcodeBatchAdvancedOverlay.d.ts} +7 -7
  8. package/dist/dts/ts/BarcodeBatchAdvancedOverlayListener.d.ts +10 -0
  9. package/dist/dts/ts/BarcodeCountView.d.ts +7 -0
  10. package/dist/dts/ts/Capacitor/{BarcodeTrackingAdvancedOverlayProxy.d.ts → BarcodeBatchAdvancedOverlayProxy.d.ts} +5 -5
  11. package/dist/dts/ts/Capacitor/{BarcodeTrackingBasicOverlayProxy.d.ts → BarcodeBatchBasicOverlayProxy.d.ts} +3 -3
  12. package/dist/dts/ts/Capacitor/{BarcodeTrackingListenerProxy.d.ts → BarcodeBatchListenerProxy.d.ts} +4 -4
  13. package/dist/dts/ts/Capacitor/BarcodeGeneratorProxy.d.ts +7 -0
  14. package/dist/dts/ts/Capacitor/BarcodeSelectionProxy.d.ts +1 -0
  15. package/dist/dts/ts/Capacitor/Capacitor.d.ts +17 -13
  16. package/dist/dts/ts/Capacitor/SparkScanViewProxy.d.ts +1 -2
  17. package/dist/dts/ts/SparkScanView.d.ts +54 -37
  18. package/dist/index.js +446 -252
  19. package/dist/index.js.map +1 -1
  20. package/ios/Plugin/BarcodeCountViewHandler.swift +11 -7
  21. package/ios/Plugin/Plugin.m +158 -153
  22. package/ios/Plugin/ScanditBarcodeCapture.swift +157 -95
  23. package/ios/Podfile +1 -1
  24. package/ios/ScanditBarcodeCapturePlugin.xcodeproj/project.pbxproj +4 -4
  25. package/package.json +4 -4
  26. package/dist/dts/ts/BarcodeTrackingAdvancedOverlayListener.d.ts +0 -10
@@ -12,10 +12,10 @@ Pod::Spec.new do |s|
12
12
  s.author = package["author"]
13
13
  s.source = { :git => package["homepage"], :tag => s.version.to_s }
14
14
  s.source_files = "ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}"
15
- s.ios.deployment_target = "13.0"
15
+ s.ios.deployment_target = "14.0"
16
16
  s.swift_version = "5.7"
17
17
 
18
18
  s.dependency "Capacitor"
19
19
  s.dependency "ScanditCapacitorDatacaptureCore", "= #{version}"
20
- s.dependency "scandit-datacapture-frameworks-barcode", '= 6.28.1'
20
+ s.dependency "scandit-datacapture-frameworks-barcode", '= 7.0.0-beta.2'
21
21
  end
@@ -56,7 +56,7 @@ repositories {
56
56
  }
57
57
 
58
58
  dependencies {
59
- def sdk_version = "6.28.1"
59
+ def sdk_version = "7.0.0-beta.2"
60
60
 
61
61
  implementation fileTree(dir: 'libs', include: ['*.jar'])
62
62
  implementation fileTree(dir: 'library', include: ['*.aar'])
@@ -31,7 +31,6 @@ import com.scandit.capacitor.datacapture.core.data.ResizeAndMoveInfo
31
31
  import com.scandit.capacitor.datacapture.core.data.SerializableCallbackAction
32
32
  import com.scandit.capacitor.datacapture.core.data.SerializableFinishModeCallbackData
33
33
  import com.scandit.capacitor.datacapture.core.errors.JsonParseError
34
- import com.scandit.capacitor.datacapture.core.utils.CapacitorNoopResult
35
34
  import com.scandit.capacitor.datacapture.core.utils.CapacitorResult
36
35
  import com.scandit.datacapture.core.ui.style.BrushDeserializer
37
36
  import com.scandit.datacapture.frameworks.barcode.BarcodeModule
@@ -40,12 +39,14 @@ import com.scandit.datacapture.frameworks.barcode.capture.listeners.FrameworksBa
40
39
  import com.scandit.datacapture.frameworks.barcode.count.BarcodeCountModule
41
40
  import com.scandit.datacapture.frameworks.barcode.count.listeners.FrameworksBarcodeCountCaptureListListener
42
41
  import com.scandit.datacapture.frameworks.barcode.count.listeners.FrameworksBarcodeCountListener
42
+ import com.scandit.datacapture.frameworks.barcode.count.listeners.FrameworksBarcodeCountStatusProvider
43
43
  import com.scandit.datacapture.frameworks.barcode.count.listeners.FrameworksBarcodeCountViewListener
44
44
  import com.scandit.datacapture.frameworks.barcode.count.listeners.FrameworksBarcodeCountViewUiListener
45
45
  import com.scandit.datacapture.frameworks.barcode.find.BarcodeFindModule
46
46
  import com.scandit.datacapture.frameworks.barcode.find.listeners.FrameworksBarcodeFindListener
47
47
  import com.scandit.datacapture.frameworks.barcode.find.listeners.FrameworksBarcodeFindViewUiListener
48
48
  import com.scandit.datacapture.frameworks.barcode.find.transformer.FrameworksBarcodeFindTransformer
49
+ import com.scandit.datacapture.frameworks.barcode.generator.BarcodeGeneratorModule
49
50
  import com.scandit.datacapture.frameworks.barcode.pick.BarcodePickModule
50
51
  import com.scandit.datacapture.frameworks.barcode.selection.BarcodeSelectionModule
51
52
  import com.scandit.datacapture.frameworks.barcode.selection.listeners.FrameworksBarcodeSelectionAimedBrushProvider
@@ -55,12 +56,13 @@ import com.scandit.datacapture.frameworks.barcode.spark.SparkScanModule
55
56
  import com.scandit.datacapture.frameworks.barcode.spark.delegates.FrameworksSparkScanFeedbackDelegate
56
57
  import com.scandit.datacapture.frameworks.barcode.spark.listeners.FrameworksSparkScanListener
57
58
  import com.scandit.datacapture.frameworks.barcode.spark.listeners.FrameworksSparkScanViewUiListener
58
- import com.scandit.datacapture.frameworks.barcode.tracking.BarcodeTrackingModule
59
- import com.scandit.datacapture.frameworks.barcode.tracking.listeners.FrameworksBarcodeTrackingAdvancedOverlayListener
60
- import com.scandit.datacapture.frameworks.barcode.tracking.listeners.FrameworksBarcodeTrackingBasicOverlayListener
61
- import com.scandit.datacapture.frameworks.barcode.tracking.listeners.FrameworksBarcodeTrackingListener
59
+ import com.scandit.datacapture.frameworks.barcode.batch.BarcodeBatchModule
60
+ import com.scandit.datacapture.frameworks.barcode.batch.listeners.FrameworksBarcodeBatchAdvancedOverlayListener
61
+ import com.scandit.datacapture.frameworks.barcode.batch.listeners.FrameworksBarcodeBatchBasicOverlayListener
62
+ import com.scandit.datacapture.frameworks.barcode.batch.listeners.FrameworksBarcodeBatchListener
62
63
  import com.scandit.datacapture.frameworks.core.deserialization.DeserializationLifecycleObserver
63
64
  import com.scandit.datacapture.frameworks.core.events.Emitter
65
+ import com.scandit.datacapture.frameworks.core.result.NoopFrameworksResult
64
66
  import com.scandit.datacapture.frameworks.core.utils.DefaultFrameworksLog
65
67
  import com.scandit.datacapture.frameworks.core.utils.DefaultMainThread
66
68
  import com.scandit.datacapture.frameworks.core.utils.DefaultWorkerThread
@@ -92,10 +94,10 @@ class ScanditBarcodeNative :
92
94
  private var corePlugin: PluginHandle? = null
93
95
  private val barcodeModule = BarcodeModule()
94
96
  private val barcodeCaptureModule = BarcodeCaptureModule(FrameworksBarcodeCaptureListener(this))
95
- private val barcodeTrackingModule = BarcodeTrackingModule(
96
- FrameworksBarcodeTrackingListener(this),
97
- FrameworksBarcodeTrackingBasicOverlayListener(this),
98
- FrameworksBarcodeTrackingAdvancedOverlayListener(this)
97
+ private val barcodeBatchModule = BarcodeBatchModule(
98
+ FrameworksBarcodeBatchListener(this),
99
+ FrameworksBarcodeBatchBasicOverlayListener(this),
100
+ FrameworksBarcodeBatchAdvancedOverlayListener(this)
99
101
  )
100
102
  private val barcodeSelectionModule = BarcodeSelectionModule(
101
103
  FrameworksBarcodeSelectionListener(this),
@@ -106,7 +108,8 @@ class ScanditBarcodeNative :
106
108
  FrameworksBarcodeCountListener(this),
107
109
  FrameworksBarcodeCountCaptureListListener(this),
108
110
  FrameworksBarcodeCountViewListener(this),
109
- FrameworksBarcodeCountViewUiListener(this)
111
+ FrameworksBarcodeCountViewUiListener(this),
112
+ FrameworksBarcodeCountStatusProvider(this)
110
113
  )
111
114
  private val barcodeFindModule = BarcodeFindModule(
112
115
  FrameworksBarcodeFindListener(this),
@@ -122,6 +125,8 @@ class ScanditBarcodeNative :
122
125
  FrameworksSparkScanFeedbackDelegate(this)
123
126
  )
124
127
 
128
+ private val barcodeGeneratorModule = BarcodeGeneratorModule()
129
+
125
130
  private val barcodeCountViewHandler: BarcodeCountViewHandler = BarcodeCountViewHandler()
126
131
  private val barcodeFindViewHandler: BarcodeFindViewHandler = BarcodeFindViewHandler()
127
132
  private val barcodePickViewHandler: BarcodePickViewHandler = BarcodePickViewHandler()
@@ -148,41 +153,45 @@ class ScanditBarcodeNative :
148
153
  }
149
154
  barcodeModule.onCreate(context)
150
155
  barcodeCaptureModule.onCreate(context)
151
- barcodeTrackingModule.onCreate(context)
156
+ barcodeBatchModule.onCreate(context)
152
157
  barcodeSelectionModule.onCreate(context)
153
158
  barcodeCountModule.onCreate(context)
154
159
  barcodeFindModule.onCreate(context)
155
160
  barcodePickModule.onCreate(context)
156
161
  sparkScanModule.onCreate(context)
162
+ barcodeGeneratorModule.onCreate(context)
157
163
  }
158
164
 
159
165
  override fun handleOnDestroy() {
160
166
  barcodeModule.onDestroy()
161
167
  barcodeCaptureModule.onDestroy()
162
- barcodeTrackingModule.onDestroy()
168
+ barcodeBatchModule.onDestroy()
163
169
  barcodeSelectionModule.onDestroy()
164
170
  barcodeCountModule.onDestroy()
165
171
  barcodeFindModule.onDestroy()
166
172
  barcodePickModule.onDestroy()
167
173
  sparkScanModule.onDestroy()
174
+ barcodeGeneratorModule.onDestroy()
168
175
  }
169
176
 
170
177
  override fun handleOnPause() {
171
178
  super.handleOnPause()
172
- barcodeFindModule.viewOnPause(CapacitorNoopResult())
179
+ barcodeFindModule.viewOnPause(NoopFrameworksResult())
173
180
  barcodePickModule.viewOnPause()
181
+ sparkScanModule.onPause()
174
182
  }
175
183
 
176
184
  override fun handleOnResume() {
177
185
  super.handleOnResume()
178
- barcodeFindModule.viewOnResume(CapacitorNoopResult())
186
+ barcodeFindModule.viewOnResume(NoopFrameworksResult())
179
187
  barcodePickModule.viewOnResume()
188
+ sparkScanModule.onResume(NoopFrameworksResult())
180
189
  }
181
190
 
182
191
  private fun checkCameraPermission(): Boolean =
183
192
  getPermissionState("camera") == PermissionState.GRANTED
184
193
 
185
- fun checkOrRequestCameraPermissions(call: PluginCall) {
194
+ private fun checkOrRequestCameraPermissions(call: PluginCall) {
186
195
  if (!checkCameraPermission()) {
187
196
  requestPermissionForAlias("camera", call, "onCameraPermissionResult")
188
197
  } else {
@@ -241,7 +250,7 @@ class ScanditBarcodeNative :
241
250
 
242
251
  barcodeModule.getDefaults() +
243
252
  mapOf("BarcodeCapture" to barcodeCaptureModule.getDefaults()) +
244
- mapOf("BarcodeTracking" to barcodeTrackingModule.getDefaults()) +
253
+ mapOf("BarcodeBatch" to barcodeBatchModule.getDefaults()) +
245
254
  mapOf("BarcodeSelection" to barcodeSelectionModule.getDefaults()) +
246
255
  mapOf("BarcodeCount" to barcodeCountModule.getDefaults()) +
247
256
  mapOf("BarcodeFind" to barcodeFindModule.getDefaults()) +
@@ -267,38 +276,38 @@ class ScanditBarcodeNative :
267
276
  }
268
277
 
269
278
  @PluginMethod
270
- fun subscribeBarcodeTrackingListener(call: PluginCall) {
271
- barcodeTrackingModule.addBarcodeTrackingListener()
279
+ fun subscribeBarcodeBatchListener(call: PluginCall) {
280
+ barcodeBatchModule.addBarcodeBatchListener()
272
281
  call.resolve()
273
282
  }
274
283
 
275
284
  @PluginMethod
276
- fun unsubscribeBarcodeTrackingListener(call: PluginCall) {
277
- barcodeTrackingModule.removeBarcodeTrackingListener()
285
+ fun unsubscribeBarcodeBatchListener(call: PluginCall) {
286
+ barcodeBatchModule.removeBarcodeBatchListener()
278
287
  call.resolve()
279
288
  }
280
289
 
281
290
  @PluginMethod
282
- fun finishBarcodeTrackingDidUpdateSession(call: PluginCall) {
283
- barcodeTrackingModule.finishDidUpdateSession(call.data.getBoolean("enabled"))
291
+ fun finishBarcodeBatchDidUpdateSession(call: PluginCall) {
292
+ barcodeBatchModule.finishDidUpdateSession(call.data.getBoolean("enabled"))
284
293
  call.resolve()
285
294
  }
286
295
 
287
296
  @PluginMethod
288
- fun setBarcodeTrackingModeEnabledState(call: PluginCall) {
289
- barcodeTrackingModule.setModeEnabled(call.data.getBoolean("enabled"))
297
+ fun setBarcodeBatchModeEnabledState(call: PluginCall) {
298
+ barcodeBatchModule.setModeEnabled(call.data.getBoolean("enabled"))
290
299
  call.resolve()
291
300
  }
292
301
 
293
302
  @PluginMethod
294
- fun subscribeBarcodeTrackingBasicOverlayListener(call: PluginCall) {
295
- barcodeTrackingModule.addBasicOverlayListener()
303
+ fun subscribeBarcodeBatchBasicOverlayListener(call: PluginCall) {
304
+ barcodeBatchModule.addBasicOverlayListener()
296
305
  call.resolve()
297
306
  }
298
307
 
299
308
  @PluginMethod
300
- fun unsubscribeBarcodeTrackingBasicOverlayListener(call: PluginCall) {
301
- barcodeTrackingModule.removeBasicOverlayListener()
309
+ fun unsubscribeBarcodeBatchBasicOverlayListener(call: PluginCall) {
310
+ barcodeBatchModule.removeBasicOverlayListener()
302
311
  call.resolve()
303
312
  }
304
313
 
@@ -426,14 +435,14 @@ class ScanditBarcodeNative :
426
435
 
427
436
  @PluginMethod
428
437
  fun clearTrackedBarcodeBrushes(call: PluginCall) {
429
- barcodeTrackingModule.clearBasicOverlayTrackedBarcodeBrushes()
438
+ barcodeBatchModule.clearBasicOverlayTrackedBarcodeBrushes()
430
439
  call.resolve()
431
440
  }
432
441
 
433
442
  @PluginMethod
434
443
  fun setBrushForTrackedBarcode(call: PluginCall) {
435
444
  try {
436
- barcodeTrackingModule.setBasicOverlayBrushForTrackedBarcode(call.data.toString())
445
+ barcodeBatchModule.setBasicOverlayBrushForTrackedBarcode(call.data.toString())
437
446
  call.resolve()
438
447
  } catch (e: JSONException) {
439
448
  call.reject(JsonParseError(e.message).toString())
@@ -443,20 +452,20 @@ class ScanditBarcodeNative :
443
452
  }
444
453
 
445
454
  @PluginMethod
446
- fun subscribeBarcodeTrackingAdvancedOverlayListener(call: PluginCall) {
447
- barcodeTrackingModule.addAdvancedOverlayListener()
455
+ fun subscribeBarcodeBatchAdvancedOverlayListener(call: PluginCall) {
456
+ barcodeBatchModule.addAdvancedOverlayListener()
448
457
  call.resolve()
449
458
  }
450
459
 
451
460
  @PluginMethod
452
- fun unsubscribeBarcodeTrackingAdvancedOverlayListener(call: PluginCall) {
453
- barcodeTrackingModule.removeAdvancedOverlayListener()
461
+ fun unsubscribeBarcodeBatchAdvancedOverlayListener(call: PluginCall) {
462
+ barcodeBatchModule.removeAdvancedOverlayListener()
454
463
  call.resolve()
455
464
  }
456
465
 
457
466
  @PluginMethod
458
467
  fun clearTrackedBarcodeViews(call: PluginCall) {
459
- barcodeTrackingModule.clearAdvancedOverlayTrackedBarcodeViews()
468
+ barcodeBatchModule.clearAdvancedOverlayTrackedBarcodeViews()
460
469
  call.resolve()
461
470
  }
462
471
 
@@ -469,7 +478,7 @@ class ScanditBarcodeNative :
469
478
  val image = getBitmapFromBase64EncodedViewData(serializationData.view?.data)
470
479
 
471
480
  mainThread.runOnMainThread {
472
- val view = barcodeTrackingModule.getTrackedBarcodeViewFromBitmap(
481
+ val view = barcodeBatchModule.getTrackedBarcodeViewFromBitmap(
473
482
  serializationData.trackedBarcodeId,
474
483
  image
475
484
  ) ?: return@runOnMainThread
@@ -479,7 +488,7 @@ class ScanditBarcodeNative :
479
488
  serializationData.view?.options?.height ?: WRAP_CONTENT
480
489
  )
481
490
 
482
- barcodeTrackingModule.setViewForTrackedBarcode(
491
+ barcodeBatchModule.setViewForTrackedBarcode(
483
492
  view,
484
493
  serializationData.trackedBarcodeId,
485
494
  serializationData.sessionFrameSequenceId
@@ -498,7 +507,7 @@ class ScanditBarcodeNative :
498
507
  @PluginMethod
499
508
  fun setOffsetForTrackedBarcode(call: PluginCall) {
500
509
  try {
501
- barcodeTrackingModule.setOffsetForTrackedBarcode(
510
+ barcodeBatchModule.setOffsetForTrackedBarcode(
502
511
  hashMapOf(
503
512
  "offset" to call.data.getString("offset"),
504
513
  "identifier" to call.data.getInt("trackedBarcodeID")
@@ -515,7 +524,7 @@ class ScanditBarcodeNative :
515
524
  @PluginMethod
516
525
  fun setAnchorForTrackedBarcode(call: PluginCall) {
517
526
  try {
518
- barcodeTrackingModule.setAnchorForTrackedBarcode(
527
+ barcodeBatchModule.setAnchorForTrackedBarcode(
519
528
  hashMapOf(
520
529
  "anchor" to call.data.getString("anchor"),
521
530
  "identifier" to call.data.getInt("trackedBarcodeID")
@@ -546,8 +555,8 @@ class ScanditBarcodeNative :
546
555
  }
547
556
 
548
557
  @PluginMethod
549
- fun resetBarcodeTrackingSession(call: PluginCall) {
550
- barcodeTrackingModule.resetSession(null)
558
+ fun resetBarcodeBatchSession(call: PluginCall) {
559
+ barcodeBatchModule.resetSession(null)
551
560
  call.resolve()
552
561
  }
553
562
 
@@ -1186,31 +1195,38 @@ class ScanditBarcodeNative :
1186
1195
  }
1187
1196
 
1188
1197
  @PluginMethod
1189
- fun updateBarcodeTrackingBasicOverlay(call: PluginCall) {
1198
+ fun updateBarcodeSelectionFeedback(call: PluginCall) {
1199
+ val feedbackJson = call.data.getString("feedbackJson")
1200
+ ?: return call.reject(WRONG_INPUT)
1201
+ barcodeSelectionModule.updateFeedback(feedbackJson, CapacitorResult(call))
1202
+ }
1203
+
1204
+ @PluginMethod
1205
+ fun updateBarcodeBatchBasicOverlay(call: PluginCall) {
1190
1206
  val overlayJson = call.data.getString("overlayJson")
1191
1207
  ?: return call.reject(WRONG_INPUT)
1192
- barcodeTrackingModule.updateBasicOverlay(overlayJson, CapacitorResult(call))
1208
+ barcodeBatchModule.updateBasicOverlay(overlayJson, CapacitorResult(call))
1193
1209
  }
1194
1210
 
1195
1211
  @PluginMethod
1196
- fun updateBarcodeTrackingAdvancedOverlay(call: PluginCall) {
1212
+ fun updateBarcodeBatchAdvancedOverlay(call: PluginCall) {
1197
1213
  val overlayJson = call.data.getString("overlayJson")
1198
1214
  ?: return call.reject(WRONG_INPUT)
1199
- barcodeTrackingModule.updateAdvancedOverlay(overlayJson, CapacitorResult(call))
1215
+ barcodeBatchModule.updateAdvancedOverlay(overlayJson, CapacitorResult(call))
1200
1216
  }
1201
1217
 
1202
1218
  @PluginMethod
1203
- fun updateBarcodeTrackingMode(call: PluginCall) {
1219
+ fun updateBarcodeBatchMode(call: PluginCall) {
1204
1220
  val modeJson = call.data.getString("modeJson")
1205
1221
  ?: return call.reject(WRONG_INPUT)
1206
- barcodeTrackingModule.updateModeFromJson(modeJson, CapacitorResult(call))
1222
+ barcodeBatchModule.updateModeFromJson(modeJson, CapacitorResult(call))
1207
1223
  }
1208
1224
 
1209
1225
  @PluginMethod
1210
- fun applyBarcodeTrackingModeSettings(call: PluginCall) {
1226
+ fun applyBarcodeBatchModeSettings(call: PluginCall) {
1211
1227
  val modeSettingsJson = call.data.getString("modeSettingsJson")
1212
1228
  ?: return call.reject(WRONG_INPUT)
1213
- barcodeTrackingModule.applyModeSettings(modeSettingsJson, CapacitorResult(call))
1229
+ barcodeBatchModule.applyModeSettings(modeSettingsJson, CapacitorResult(call))
1214
1230
  }
1215
1231
 
1216
1232
  @PluginMethod
@@ -1289,14 +1305,6 @@ class ScanditBarcodeNative :
1289
1305
  call.resolve()
1290
1306
  }
1291
1307
 
1292
- @PluginMethod
1293
- fun emitSparkScanViewFeedback(call: PluginCall) {
1294
- sparkScanModule.emitFeedback(
1295
- call.data.getString("feedback").orEmpty(),
1296
- CapacitorResult(call)
1297
- )
1298
- }
1299
-
1300
1308
  @PluginMethod
1301
1309
  fun finishSparkScanDidUpdateSessionCallback(call: PluginCall) {
1302
1310
  sparkScanModule.finishDidUpdateSessionCallback(call.data.getBoolean("enabled"))
@@ -1370,4 +1378,53 @@ class ScanditBarcodeNative :
1370
1378
  CapacitorResult(call)
1371
1379
  )
1372
1380
  }
1381
+
1382
+ @PluginMethod
1383
+ fun createBarcodeGenerator(call: PluginCall) {
1384
+ val barcodeGeneratorJson = call.data.getString("barcodeGeneratorJson")
1385
+ ?: return call.reject(WRONG_INPUT)
1386
+ barcodeGeneratorModule.createGenerator(barcodeGeneratorJson, CapacitorResult(call))
1387
+ }
1388
+
1389
+ @PluginMethod
1390
+ fun generateFromBase64EncodedData(call: PluginCall) {
1391
+ val generatorId = call.data.getString("generatorId")
1392
+ ?: return call.reject(WRONG_INPUT)
1393
+ val data = call.data.getString("data")
1394
+ ?: return call.reject(WRONG_INPUT)
1395
+ val imageWidth = call.data.getInteger("imageWidth")
1396
+ ?: return call.reject(WRONG_INPUT)
1397
+
1398
+ barcodeGeneratorModule.generateFromBase64EncodedData(
1399
+ generatorId,
1400
+ data,
1401
+ imageWidth,
1402
+ CapacitorResult(call)
1403
+ )
1404
+ }
1405
+
1406
+ @PluginMethod
1407
+ fun generateFromString(call: PluginCall) {
1408
+ val generatorId = call.data.getString("generatorId")
1409
+ ?: return call.reject(WRONG_INPUT)
1410
+ val text = call.data.getString("text")
1411
+ ?: return call.reject(WRONG_INPUT)
1412
+ val imageWidth = call.data.getInteger("imageWidth")
1413
+ ?: return call.reject(WRONG_INPUT)
1414
+
1415
+ barcodeGeneratorModule.generate(
1416
+ generatorId,
1417
+ text,
1418
+ imageWidth,
1419
+ CapacitorResult(call)
1420
+ )
1421
+ }
1422
+
1423
+ @PluginMethod
1424
+ fun disposeBarcodeGenerator(call: PluginCall) {
1425
+ val generatorId = call.data.getString("generatorId")
1426
+ ?: return call.reject(WRONG_INPUT)
1427
+
1428
+ barcodeGeneratorModule.disposeGenerator(generatorId, CapacitorResult(call))
1429
+ }
1373
1430
  }