[BUG] READ_EXTERNAL_STORAGE permission on Android 13
See original GitHub issueIs there an existing issue for this?
- I have searched the existing issues
Did you read the “Reporting a bug” section on Contributing file?
- I have read the “Reporting a bug” section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug
Current Behavior
The newly added feature FolderPicker is not working properly on Android 13. As of Android 13 (Api 33), it is no longer possible to use READ_EXTERNAL_STORAGE. The new permissions are:
- Images and photos: READ_MEDIA_IMAGES
- Videos: READ_MEDIA_VIDEO
- Audio files: READ_MEDIA_AUDIO
As can be seen here Android 13 Behavior Changes,
Expected Behavior
We could just probably check if API is smaller than API 33 and then use READ_EXTERNAL_STORAGE otherwise request READ_MEDIA_IMAGES, READ_MEDIA_VIDEO, READ_MEDIA_AUDIO, or from my testing we don’t need to request permission at all since if we want to request folder to which we don’t we have permission this permission will be automatically requested via folder picker.
Steps To Reproduce
Try to run the FilePicker on a device with Android 13 (API 33).
Link to public reproduction project repository
We can just use Sample from https://github.com/CommunityToolkit/Maui/tree/main/samples/CommunityToolkit.Maui.Sample itself.
Environment
- .NET MAUI CommunityToolkit: 4.0.0
- OS: Windows 10 Enterprise Build 19044.2486
- .NET MAUI: 7.0.59 Service Release 3
Anything else?
No response
Issue Analytics
- State:
- Created 7 months ago
- Comments:10
Thank you for this workaround! @zZHorizonZz 😃
@zZHorizonZz it is not an issue of CommunityToolkit. It’s better to open the issue in .NET MAUI repo on Permissions.RequestAsync API