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

Error occurs when selecting one or more images which needs to be downloaded from iCloud and there is no connectivity (to download them) #100

Open ryaa opened 4 years ago

ryaa commented 4 years ago

This plugin uses [[PHImageManager defaultManager] requestImageDataForAsset:...] in imageToSandbox method. However this function only works for images that reside on the phones memory or that were recently fetched from iCloud by your app on any other one and if there is no connectivity this method returns nil for the image which causes the problem.

The plugin simply returns an error which is null and no other details.

For example, the camera plugin, when such a photo (which needs to be downloaded from iCloud) is selected by the user shows the below error dialog and prevents from selecting it IMG_3399

Is it possible to implement similar behaviour?

ryaa commented 4 years ago

I implemented the change to handle the above use case and return an error message if the photo is in iCloud and download fails - see https://github.com/DmcSDK/cordova-plugin-mediaPicker/pull/101