I am using the Xamarin.Essentials MediaPicker for capturing images in my app. https://learn.microsoft.com/de-de/xamarin/essentials/media-picker?tabs=android
just like var photo = await MediaPicker.CapturePhotoAsync();
For Android < 13 I am asking for permissions:
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
and everything works fine.
Since those permission do not work for Android 13, I am asking for
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
(see Android 13 - How to request WRITE_EXTERNAL_STORAGE)
the problem is, that the Xamarin.Essentials.MediaPicker still misses the StorageWritePermission when trying to take a photo. But I can't ask for those in Android 13.
Any ideas how to make it work for Android 13?
Info:
- Uploading an image works fine (
MediaPicker.PickPhotoAsync
) - Device tested: Samsung Galaxy Tab 7 FE Android 13
- Device tested: Google Pixle 7 Android 13
- Bug thread https://github.com/xamarin/Essentials/issues/2041
Update:
- Pull request https://github.com/xamarin/Essentials/pull/2065 which could fix this problem