2

I am using the file_picker library. when an iOS user is requested for photo permission, even though certain photos are selected by pressing “Select Photos...”, all images are displayed so that all images can be selected.

      if (!photoStatus.isGranted && !photoStatus.isLimited) {
        await Permission.photos.request();
        photoStatus = await Permission.photos.status;
        if (!photoStatus.isGranted && !photoStatus.isLimited) {
          showDialog(
              context: context, builder: (context) => PhotoPermissionAlert());
          photoStatus = await Permission.photos.status;
          if (!photoStatus.isGranted && !photoStatus.isLimited) {
            return;
          }
        }
      }
FilePickerResult? result = await FilePicker.platform
        .pickFiles(type: FileType.media, allowMultiple: true);

Shouldn't we only show photos that the user has granted access to our app? How can I do that?

Queen Ellery
  • 481
  • 1
  • 6
  • 11
  • It's unclear from your question whether the user grants the app permission or not. If they did, the entire photo library is available to the picker on iOS. – Dan Harms May 21 '22 at 13:27
  • @Dan Harms) When you ask the user for permission to access the album, “Select Photos”, “Alllow Access to All Photos”, and “Don’t Allow” buttons appear. However, even if the user selects “Select Photos” to allow only certain photos, all photos can be selected. – Queen Ellery May 23 '22 at 01:04
  • 1
    The plugin uses `UIImagePickerController` under the hood. For read-only access, it does not need any permissions to access photos. See https://stackoverflow.com/questions/48826060/uiimagepickercontroller-not-asking-for-permission – Dan Harms May 23 '22 at 01:08
  • @Dan Harms When we open an album, don't we get penalized if we don't ask for permission? Our app does not add photos to albums. – Queen Ellery May 26 '22 at 04:58
  • Has anyone got the solution for this? – Pooja Patil Nov 03 '22 at 09:34

0 Answers0