UnityNativeGallery icon indicating copy to clipboard operation
UnityNativeGallery copied to clipboard

Saving into an iOS album iOS 14+

Open mikerz opened this issue 3 years ago • 3 comments

Hello --

We've used your asset for a while, and it has been great.

I guess this isn't technically a bug since the documentation specifies this behaviour: On Android, your images/videos are saved at DCIM/album/filename. On iOS 14+, the image/video will be saved to the default Photos album (i.e. album parameter will be ignored). On earlier iOS versions, the image/video will be saved to the target album. Make sure that the filename parameter includes the file's extension, as well

The album parameter is ignored -- why is this? Is there any way around it? It doesn't seem like an iOS limitation.

Is this an area that you would like a Pull Request to help implement, or is this otherwise a design decision?

mikerz avatar Feb 03 '22 23:02 mikerz

To be able to save to custom albums, we need to present the following permission dialog and the user must select All Photos option:

ss

Downsides are:

  • The main reason is, because of how NativeGallery asks permissions synchronously, Select Photos option freezes and then crashes the app
  • User must select the All Photos option but that doesn't make sense, who would give All Photos permission to save an image
  • Showing Select Photos option while saving an image doesn't make sense either

yasirkula avatar Feb 04 '22 06:02 yasirkula

And How can we present this permission to the user ?

Shady9595 avatar Apr 12 '22 09:04 Shady9595

You can set this value to false but I'm not taking responsibility for crashes/freezes that will occur when Select Photos option is selected: https://github.com/yasirkula/UnityNativeGallery/blob/62de2dc50ab85e57fafa105909247470155a4ad7/Plugins/NativeGallery/NativeGallery.cs#L165-L173

yasirkula avatar Apr 12 '22 16:04 yasirkula