jamesmontemagno / MediaPlugin

Take & Pick Photos and Video Plugin for Xamarin and Windows
MIT License
711 stars 360 forks source link

Is there away to remove selected photos (Select Photos..) from permissions dialog? / Funny permission issues #936

Closed jsuske1985 closed 2 years ago

jsuske1985 commented 3 years ago

Hi All,

I was wondering if there is away to remove the selected photos (Select Photos..) from the permissions dialog and just have Allow Access to All Photos and Don't Allow?

Here is my code:

if (!CrossMedia.Current.IsPickPhotoSupported)
                {
                    await DisplayAlert("Photos Not Supported", "Sorry! Permission not granted to photos.", "OK");
                    return;
                }

                MediaFile file = null;

                if (await Permissions.RequestAsync<Permissions.Photos>() == Xamarin.Essentials.PermissionStatus.Granted)
                {
                    file = await Plugin.Media.CrossMedia.Current.PickPhotoAsync(new Plugin.Media.Abstractions.PickMediaOptions
                    {
                        PhotoSize = Plugin.Media.Abstractions.PhotoSize.Medium,

                    });
                }

                if (file == null)
                    return;

                var imageSource = ImageSource.FromStream(() =>
                {
                    var stream = file.GetStream();
                    return stream;
                });

                PickImage.Source = imageSource;

Is this even possible? I also notice when I do select "Select Photos..." And then select the photos that i am allowing the app to use, the library comes up again and I am allow to select any photo I want, even the ones I did not select the first time around.

jamesmontemagno commented 2 years ago

No, this is iOS doing it