question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: iOS 14 new Photos picker permission is not handled correctly

See original GitHub issue

Bug Report

Capacitor Version

   Capacitor CLI   : 2.4.2
   @capacitor/core : 2.4.2

Platform(s)

Current Behaviour

Pre-requisite

There are two one use case:

  1. 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 allowed 2.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 app 3.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:closed
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
jcesarmobilecommented, Jun 22, 2021

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”

1reaction
imhoffdcommented, Feb 2, 2021

@ryaa I believe this issue was fixed for Capacitor 3 in the new camera plugin.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Photo Library - How to handle limited access - Apple Developer
I want the user to be able to choose limited access. In my app I need to be able to access the photo,...
Read more >
How to Manage Photo Library Permission in iOS - Swift Senpai
This article shows you how to manage each and every photo authorization status, including the limited access status introduced in iOS 14.
Read more >
iOS 14 Camera and Photo Permission Flow - Stack Overflow
If the user taps the camera button, accepts the permission request, takes a photo and taps “Use Photo”, the UIImagePickerController is dismissed ...
Read more >
Photo library changes in iOS 14 - MacKuba
By default if the user grants limited access to the photo library to an app, they will see the same popup again after...
Read more >
How to use the limited photos picker in iOS 14 for added privacy
After you upgrade to iOS 14 and go to select a photo in an app, you'll notice a new photo permissions dialog that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found