capacitor-camera-module 0.0.22 → 0.0.23

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.
@@ -458,25 +458,24 @@ public class CameraModulePlugin extends Plugin {
458
458
  @PluginMethod
459
459
  public void getLastGalleryImage(PluginCall call) {
460
460
 
461
- if (getPermissionState("gallery") != PermissionState.GRANTED) {
461
+ String alias = Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU ? "gallery_13" : "gallery_pre13";
462
+
463
+ if (getPermissionState(alias) != PermissionState.GRANTED) {
462
464
  call.reject("Gallery permission not granted");
463
465
  return;
464
466
  }
465
467
 
466
468
  Uri uri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
467
469
 
468
- String[] projection = {
469
- MediaStore.Images.Media._ID
470
- };
471
-
470
+ String[] projection = { MediaStore.Images.Media._ID };
472
471
  String sortOrder = MediaStore.Images.Media.DATE_ADDED + " DESC";
473
472
 
474
473
  try (Cursor cursor = getContext().getContentResolver().query(
475
- uri,
476
- projection,
477
- null,
478
- null,
479
- sortOrder
474
+ uri,
475
+ projection,
476
+ null,
477
+ null,
478
+ sortOrder
480
479
  )) {
481
480
  if (cursor != null && cursor.moveToFirst()) {
482
481
  long id = cursor.getLong(0);
@@ -500,4 +499,5 @@ public class CameraModulePlugin extends Plugin {
500
499
 
501
500
 
502
501
 
502
+
503
503
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capacitor-camera-module",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
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",