cordova-plugin-camera icon indicating copy to clipboard operation
cordova-plugin-camera copied to clipboard

Privacy: permission to access photo library not requested and leading to apple review rejections

Open dcxn opened this issue 5 years ago • 6 comments

Bug Report

Problem

Same issue detailed here: https://github.com/ionic-team/ionic-native/issues/2634

When accessing feature that requires access to the users camera roll on clean app install, app is not asking and showing the privacy popup permission to allow access to the photo library of the user when sourceType: PictureSourceType.PHOTOLIBRARY, which led to Apple rejecting the app.

What is expected to happen?

Permission should be asked to the user. Privacy popup should be shown with the adequate plist text (eg. NSPhotoLibraryUsageDescription) so user can accept or deny access.

What does actually happen?

App instantly opens the user camera roll without asking for permission, as if it had access by default.

Information

When sourceType: PictureSourceType.CAMERA, plugin seems to work as expected and asks for permission first.

Environment, Platform, Device

Tested in several iphones and simulators on iOS 13.

Version information

Cordova 9, [email protected], [email protected]. Cannot update to cordova-ios 6 yet due to incompatibility with certain plugins. Ionic 5 and ionic CLI 5.4.16.

Checklist

  • [x] I searched for existing GitHub issues
  • [x] I updated all Cordova tooling to most recent version
  • [x] I included all the necessary information above

dcxn avatar Sep 01 '20 08:09 dcxn

Anyone have an idea how to fix this?

spinninghamster avatar Sep 13 '20 05:09 spinninghamster

As a stopgap solution, you can use the cordova-diagnostic-plugin's camera roll authorization methods, that is isCameraRollAuthorized and getCameraRollAuthorizationStatus to query state and requestCameraRollAuthorization to request user for the access right.

faugusztin avatar Sep 13 '20 08:09 faugusztin

Yes, check @faugusztin comment for a workaround. We ended up doing the same due to the urgency of pushing the update, but it ain't a great solution long term to add this unnecessary extra plugin bloat to fix another plugin's bug.

I opened the ticket in hopes the bug can be fixed on the source (if it is indeed coming from cordova plugin camera). It makes the most sense and we could avoid using the extra plugin for this.

dcxn avatar Sep 14 '20 12:09 dcxn

Any fix for this??

nileshbandekar avatar Jul 11 '22 09:07 nileshbandekar

@nileshbandekar Using the diagnostic plugin still seems to be the only way. New releases of the camera plugin have not addressed this issue yet, thus why it's still open.

dcxn avatar Aug 18 '22 11:08 dcxn

@nileshbandekar Using the diagnostic plugin still seems to be the only way. New releases of the camera plugin have not addressed this issue yet, thus why it's still open.

I guess the dev version of the camera plugin has the required bug fix but it's not working perfectly yet...

nileshbandekar avatar Aug 18 '22 11:08 nileshbandekar