Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IOS] All photos are available even though only some photos are allowed to access #877

Open
3 tasks done
hieunguyen2211 opened this issue Dec 20, 2023 · 4 comments
Open
3 tasks done

Comments

@hieunguyen2211
Copy link

hieunguyen2211 commented Dec 20, 2023

Bug Report

Problem

In IOS, when accessing the gallery, there is a dialog and the user needs to choose an option to grant access gallery permission to the application. If the user chooses "Select more photos...", there is a view for him/her to select which photos can be accessed. However, after that, in the next view, where the user can select a photo to import to the application, the user can access all photos in the gallery instead of only selected photos in the previous view => Granting read access for some photos does not work.

What is expected to happen?

When the user selects photos in the gallery to import to his/her application, only some photos, that are granted access, will be displayed.

What does actually happen?

When the user selects photos in the gallery to import to his/her application, all photos are displayed regardless ungranted access permission

Information

The requestPhotoPermissions method in CDVCamera.m is using deprecated API from PHPhotoLibrary: authorizationStatus and requestAuthorization. These 2 deprecated methods cannot return the correct value when the user chooses the "Select more photos..." option. 2 alternative methods for those are: authorizationStatusForAccessLevel and requestAuthorizationForAccessLevel, which can return the correct value: PHAuthorizationStatusLimited instead of PHAuthorizationStatusAuthorized.

Environment, Platform, Device

Iphone 14 (IOS 16.6)

Version information

  • Cordova: 12.0.0
  • Cordova-ios: 7.0.0
  • Cordova-plugin-camera: 7.0.0

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@NityaSantosh26
Copy link

+1. Same issue for me with iOS.

@DuyTrinh94
Copy link

+1. I also meet this issue with my iOS device

@jcesarmobile
Copy link
Member

There is no difference in knowing which option the user selected, the photo picker doesn't really need any permissions to work. Choosing the "limited" option, the only thing that limit is accessing privacy related information about the picture, such as the exif data, so that's why the picker shows all pictures, because no permission is required for accessing them.

But it's true that it's very confusing, not sure if the code should be changed to not request permissions or to add an option to request it or not.

@hieunguyen2211

This comment was marked as abuse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants