xamarin / Essentials

Xamarin.Essentials is no longer supported. Migrate your apps to .NET MAUI, which includes Maui.Essentials.
https://aka.ms/xamarin-upgrade
Other
1.53k stars 505 forks source link

Fix MediaPicker capture methods in Android 13+ #2073

Closed mattleibow closed 1 year ago

mattleibow commented 1 year ago

Thanks to @Ghostbird in https://github.com/dotnet/maui/pull/12766

Description of Change

Fix the MediaPicker that is requesting permissions that are not correct for Android 33.

Bugs Fixed

Provide links to issues here. Ensure that a GitHub issue was created for your feature or bug fix before sending PR.

API Changes

None.

Behavioral Changes

Skips the check for StorageWrite because that permission is not needed and probably not needed in many versions...

PR Checklist

mattleibow commented 1 year ago

/azp run

azure-pipelines[bot] commented 1 year ago
Azure Pipelines successfully started running 1 pipeline(s).
JaixTim commented 1 year ago

Is there an ETA on 1.7.5 milestone with this fix?

JaixTim commented 1 year ago

Does anyone realise the latest release that this PR went into is not on nuget due to a build failure? Is there anyone able to fix that?

jfversluis commented 1 year ago

Sorry it took a little while @JaixTim! I have just released it now

suhas100 commented 1 year ago

@jfversluis are you working on a solution for this?

jfversluis commented 1 year ago

@suhas100 this is fixed and released as part of Essentials 1.7.5

ToolmakerSteve commented 1 year ago

@jfversluis - this SO thread says they are using Xamarin.Essentials(1.7.5), but still getting "Denied" when they do MediaPicker.PickPhotoAsync.

Ghostbird commented 1 year ago

@ToolmakerSteve Note that the SO talks about the read permission when using PickPhotoAsync. The error that was fixed in MAUI and merged in this PR, is that it incorrectly requested write permissions when using CapturePhotoAsync. This seems a completely different bug. What they share is that they are both ultimately caused by permission changes in the Android API.