jamesmontemagno/MediaPlugin

Camera permission error Android 13 api 33

BDPRICA opened this issue · 6 comments

When opening the camera with Android 13 api 33, the following error is displayed: Camera permission(s) are required.
at Plugin.Media.MediaImplementation.TakePhotoAsync (Plugin.Media.Abstractions.StoreCameraMediaOptions options, System.Threading.CancellationToken token)

The permissions that are assigned are:







Img_error

The code to test is the following:
public async Task Evento_tomar_foto()
{
string basef1 = "";
try
{
await CrossMedia.Current.Initialize();

            if (CrossMedia.Current.IsCameraAvailable && CrossMedia.Current.IsTakePhotoSupported)
            {
                // Take a photo of the business receipt.
                var file = await CrossMedia.Current.TakePhotoAsync(new StoreCameraMediaOptions
                {
                    SaveToAlbum = true,
                    Name = $"{DateTime.UtcNow}.jpg",
                    CompressionQuality = 80,
                    MaxWidthHeight = 250

                });
                if (file != null)
                {
                    //Convertir a base 64
                    FileStream fs = new FileStream(file.Path, FileMode.Open, FileAccess.Read);

                    byte[] ImageData = new byte[fs.Length];

                    fs.Read(ImageData, 0, System.Convert.ToInt32(fs.Length));

                    fs.Dispose();

                    basef1 = Convert.ToBase64String(ImageData);//Guarda la img en base64  
                }
            }
        }
        catch(Exception ex)
        {
            Console.WriteLine(ex.Message);
        }
        
        return basef1;
    }

Same issue even if I asked for READ_MEDIA_IMAGES permission. I have not found any workaround.

Same here. Works as expected for api 32

This issue is fixed in 6.0.1-beta.

HI James, thanks for your work and the information. When will version 6.0.1 be released.

HI James, thanks for your work and the information. When will version 6.0.1 be released.

6.0.1 is available as pre-release package on NuGet: https://www.nuget.org/packages/Xam.Plugin.Media/6.0.1-beta

When will version 6.0.1 be released ?