DmcSDK / cordova-plugin-mediaPicker

cordova android ios mediaPicker support selection of multiple image and video gif ✨ cordova android 和 ios 图片视频选择cordova插件,支持多图 视频 gif,ui类似微信
MIT License
139 stars 93 forks source link

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

Open ryaa opened 5 years ago

ryaa commented 5 years ago

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 https://github.com/apache/cordova-common/pull/24#issuecomment-393053654

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 commented 5 years ago

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 commented 5 years ago

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 https://github.com/apache/cordova-cli/issues/446

ryaa commented 5 years ago

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 https://github.com/DmcSDK/cordova-plugin-mediaPicker/pull/95

syteo commented 3 years ago

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