bug: iOS 14 new Photos picker permission is not handled correctly
See original GitHub issueBug Report
Capacitor Version
Capacitor CLI : 2.4.2
@capacitor/core : 2.4.2
Platform(s)
Current Behaviour
Pre-requisite
- create the ionic angular application with camera/image picker support as described here https://ionicframework.com/docs/angular/your-first-app For the camera getPhoto method use the default CameraSource.Prompt - see https://capacitorjs.com/docs/apis/camera#camerasource
There are two one use case:
- No permissions for photo has been granted 1.1) Change from all photo access to no photo access in Settings as described below
- Open the Settings app.
- Select Privacy | Photo | App.
- Select None under Allow Photos Access
1.2) open the app
1.3) start the camera and choose From Photos (to load a photo)
Note that the picker will be dismissed silently without showing any UI or message which might be confusing for the user
2) Limited subset of photos are allowed2.1) Change from all photo access to Selected Photos access in Settings as described below- Open the Settings app.- Select Privacy | Photo | App.- Select Selected Photos under Allow Photos Access but DON’T select any photos and tap Done (no photos should be allowed)2.2) open the app3.3) start the camera and choose From Photos (to load a photo)Note that the picker will show all the photos (even though the user has not granted access to them) and allows to select and load the photo.
Expected Behavior
For the use case #1 the app should show either empty picker or some message and NOT dismiss silently
For the use case #2 the app should show and allow to choose only the photos that the user has granted permission for.
Code Reproduction
N/A
Other Technical Details
Ionic:
Ionic CLI : 6.10.1 (/Users/alexryltsov/.nvm/versions/node/v12.18.1/lib/node_modules/@ionic/cli) Ionic Framework : @ionic/angular 5.3.1 @angular-devkit/build-angular : 0.901.9 @angular-devkit/schematics : 8.0.0 @angular/cli : 9.1.9 @ionic/angular-toolkit : 2.2.0
Capacitor:
Capacitor CLI : 2.4.2 @capacitor/core : 2.4.2
Utility:
cordova-res : 0.15.1 native-run : not installed
System:
NodeJS : v12.18.1 (/Users/alexryltsov/.nvm/versions/node/v12.18.1/bin/node) npm : 6.14.5 OS : macOS Catalina
pod --version
output (iOS issues only):
1.9.1
Additional Context
iOS 14 introduced new photo picker with enhanced permission management which the capacitor camera plugin does not seem to handle correctly
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (2 by maintainers)
Top GitHub Comments
I’ve verified that the problem doesn’t happen on Capacitor 3 and @capacitor/camera plugin
about knowing if the user selected the all or selected photos, checkPermissions can be used, will return limited if the user used the “selected photos”
@ryaa I believe this issue was fixed for Capacitor 3 in the new camera plugin.