Privacy: permission to access photo library not requested and leading to apple review rejections
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
Anyone have an idea how to fix this?
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.
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.
Any fix for this??
@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.
@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...