capacitor-camera-module 0.0.32 → 0.0.33

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.
@@ -653,6 +653,16 @@ public class CameraModulePlugin extends Plugin {
653
653
  @PluginMethod
654
654
  public void startBarcodeScan(PluginCall call) {
655
655
 
656
+ if (previewView == null) {
657
+ call.reject("Preview not started");
658
+ return;
659
+ }
660
+
661
+ if (getPermissionState("camera") != PermissionState.GRANTED) {
662
+ call.reject("Camera permission not granted");
663
+ return;
664
+ }
665
+
656
666
  if (cameraProvider == null) {
657
667
  call.reject("Camera not initialized");
658
668
  return;
@@ -675,7 +685,7 @@ public class CameraModulePlugin extends Plugin {
675
685
 
676
686
  imageAnalysis.setAnalyzer(
677
687
  ContextCompat.getMainExecutor(getContext()),
678
- image -> processBarcode(image)
688
+ this::processBarcode
679
689
  );
680
690
 
681
691
  cameraProvider.unbindAll();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capacitor-camera-module",
3
- "version": "0.0.32",
3
+ "version": "0.0.33",
4
4
  "description": "Plugin to request permissiones view camera take phots",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",