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

Consider removing IOS_PHOTO_LIBRARY_USAGE_DESCRIPTION variable from installation command or make it optional #94

Open
ryaa opened this issue Nov 12, 2019 · 4 comments

Comments

@ryaa
Copy link
Contributor

ryaa commented Nov 12, 2019

I have other plugins that require to have NSPhotoLibraryUsageDescription key in plist file so I have already added the below in my config.xml to set this key before using this plugin

        <edit-config file="*-Info.plist" mode="merge" target="NSPhotoLibraryUsageDescription">
            <string>This app requires photo library access to support adding photo attachments.</string>
        </edit-config>

The latest version of this plugin requires to provide IOS_PHOTO_LIBRARY_USAGE_DESCRIPTION variable during installation to add the same key to plist file.

So now it seems trying to set this property from both, the plugin.xml and config.xml and causes the problem when I try to restore platform/plugins. This problem is intermittent so I'm not 100% sure yet but I saw several reports about the problems when plugin.xml/config.xml wanting to make conflicting changes caused problems - see apache/cordova-common#24 (comment)

Besides, I'm not sure if this is a good idea to set this general NSPhotoLibraryUsageDescription key by the plugin since this is not this plugin specific thing.

@TDola
Copy link

TDola commented Nov 12, 2019

Also weirdly this is making it impossible to remove the plugin because it complains that you have to provide the variable description to remove it. This made upgrading the plugin particularly frustrating.

@ryaa
Copy link
Contributor Author

ryaa commented Nov 12, 2019

Also weirdly this is making it impossible to remove the plugin because it complains that you have to provide the variable description to remove it. This made upgrading the plugin particularly frustrating.

This seems to be a known limitation/bug with cordova 9 - see apache/cordova-cli#446

@ryaa ryaa changed the title Consider removing IOS_PHOTO_LIBRARY_USAGE_DESCRIPTION variable from installation command Consider removing IOS_PHOTO_LIBRARY_USAGE_DESCRIPTION variable from installation command or make it optional Nov 12, 2019
@ryaa
Copy link
Contributor Author

ryaa commented Nov 13, 2019

Also weirdly this is making it impossible to remove the plugin because it complains that you have to provide the variable description to remove it. This made upgrading the plugin particularly frustrating.

I found that the only way to remove the plugin is first remove android platform (cordova platforms rm android) and then remove plugin command works.

Added a pull request to make IOS_PHOTO_LIBRARY_USAGE_DESCRIPTION variable in the installation command optional #95

@syteo
Copy link

syteo commented Nov 15, 2021

It seems IOS_PHOTO_LIBRARY_USAGE_DESCRIPTION variable is still required when adding to iOS. Is there a fix for this?

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

3 participants