jamesmontemagno / MediaPlugin

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

PickPhotoAsync works with mobile and other mobile not working #643

Open mennamagdy182 opened 5 years ago

mennamagdy182 commented 5 years ago

Version Number of Plugin: 4.0.1.5 Device Tested On: Oppo F7 ( Android 8.1) ,, Samsung - J510H ( Android 7.1) Version of Xamarin: 3.4.0.1008975

Actual Behavior

I pick a photo from Gallery and it always returns null .. It works with the Samsung device but it doesn't work with Oppo

Code snippet

   private async void PickPhoto_Clicked(object sender, EventArgs e)
    {
        if (!CrossMedia.Current.IsPickPhotoSupported)
        {
            await DisplayAlert("Photos Not Supported", ":( Permission not granted to photos.", "OK");
            return;
        }
        var file = await CrossMedia.Current.PickPhotoAsync(new PickMediaOptions()
        {
            PhotoSize = PhotoSize.Medium,
        });

        if (file == null)return;

        image.Source = ImageSource.FromStream(() =>
        {
            var stream = file.GetStream();
            file.Dispose();
            return stream;
        });
mennamagdy182 commented 5 years ago

@jamesmontemagno

jamesmontemagno commented 5 years ago

Tagging me doesn't make things go faster at all.

mennamagdy182 commented 5 years ago

Ok, Can you help me ?!

jamesmontemagno commented 5 years ago

I would start by closing the source code and debugging on your specific device. I can't possibly own and test on every random device. That is the best way to start to figure out what is going on.

mennamagdy182 commented 5 years ago

Thank You James. I understood the reason of the problem .. I use "mobile settings app lock" for the images but on selecting the image I enter the password but It doesn't work .. It worked when I remove app lock of Images .. But I have to implement it with all possible cases. It is about the integration with the operating system

ricky1402 commented 3 years ago

did you find the solution of this? I am also facing same issue. Selection of image not working for some device using CrossMedia.Current.PickPhotoAsync(

ricky1402 commented 3 years ago

@mennamagdy182 @jamesmontemagno