CommunityToolkit / Maui

The .NET MAUI Community Toolkit is a community-created library that contains .NET MAUI Extensions, Advanced UI/UX Controls, and Behaviors to help make your life as a .NET MAUI developer easier
https://learn.microsoft.com/dotnet/communitytoolkit/maui
MIT License
2.28k stars 402 forks source link

[BUG] Microsoft.Maui.Media.mediapicker is asking permission 2 times only in android, iOS working fine. #1115

Closed sbkrishnan2506 closed 1 year ago

sbkrishnan2506 commented 1 year ago

Is there an existing issue for this?

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

Hi,

I tried to use the media picker functionality, Used the media picker from the MAUI essentials. When i click on the CapturePhotoAsync() method it is asking the permission popup 2 times (1 for photos & media, another one for take pictures & record video).

I have added the sample code with both the approaches.

If I tried with the same functionality with Xam.plugin.media it is asking the permission only ones.

Expected Behavior

It should ask only one permission.

Steps To Reproduce

  1. open the application and run in a android device.
  2. Click on the button (Capture Photo MAUI media).
  3. you can see the 2 permission popups.

Remove the permission from device settings. try with Capture photo button it will ask only one permission(Implemented by xam.plugin.media).

Link to public reproduction project repository

https://github.com/sbkrishnan2506/MAUIMedia

Environment

- .NET MAUI CommunityToolkit:
- OS:
- .NET MAUI:
Media Picker
Android Permission

Anything else?

AndroidPermission2 AndroidPermission1

ramonB1996 commented 1 year ago

I tried your repository and I can see the bug you mention. However, you do not do anything with CommunityToolkit.Maui, but only use Xam.Plugin.Media. Please tell me if I am wrong, but this seems like the wrong place to report this bug.

bijington commented 1 year ago

@ramonB1996 is correct this is not the repository you want. You want to raise your issue directly against .NET MAUI here https://github.com/dotnet/maui

This repository is for a toolkit built on top of .NET MAUI

sbkrishnan2506 commented 1 year ago

Thanks @bijington I will report this issue in the repository you mentioned.