You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In WSA build 2301:
Write a .NET MAUI application that:
Sets the READ/WRITE permissions in the Platforms\Android\AndroidManifest.xml with the following syntax
And uses the CommunityToolkit.MAUI folder picker with the following syntax
CancellationTokenSourcesource=new();CancellationTokencancellationToken=source.Token;varfolderPickerResult=awaitFolderPicker.PickAsync(cancellationToken);if(folderPickerResult.IsSuccessful){awaitToast.Make($"Folder picked: Name - {folderPickerResult.Folder.Name}, Path - {folderPickerResult.Folder.Path}",ToastDuration.Long).Show(cancellationToken);}else{awaitToast.Make($"Folder is not picked, {folderPickerResult.Exception.Message}").Show(cancellationToken);}
Expected to get a "Allow XYZ to access photos and media on your device?" prompt, followed by a folder picker showing the same folder structure that would come up on an Android device or emulator.
This code works as expected for Android devices and emulators.
❌ Actual Behavior
Permissions prompt does not appear and call to FolderPicker.PickAsync comes back a FolderPickerResult.object with the IsSuccessful property set to false and the Exception.Message property set to "Storage permission is not granted."
If you set the permissions via adb with the syntax like the following:
adb -s 127.0.0.1:58526 shell pm grant com.companyname.wsapermissions android.permission.READ_EXTERNAL_STORAGE
Then the folderpicker comes up in the expected folder. You are still not prompted to give the app permissions until you actually pick a folder.
Other Software
Using .NET MAUI 7 with Visual Studio 17.6.0 on Windows 11
Please specify the version of Windows Subsystem for Android
2301.40000.7.0
The text was updated successfully, but these errors were encountered:
I just tested on a Samsung Galaxy S22 running Android 13 and saw the same issue. I tried adding the granular media permissions as described by Google, but that didn't change the problem. But it's not a WSA "thing", it's a CommunityToolkit thing. !I'll file this in that repoIt was reported and requires a fix to MAUI and this one can be closed as works as designed.
Steps to reproduce
In WSA build 2301:
Write a .NET MAUI application that:
Sets the READ/WRITE permissions in the Platforms\Android\AndroidManifest.xml with the following syntax
And uses the CommunityToolkit.MAUI folder picker with the following syntax
I have taken the sample .NET MAUI project and replaced the sample code with a button that will invoke the filepicker. This projects can be cloned from https://github.com/anotherlab/wsapermissions
✔️ Expected Behavior
Expected to get a "Allow XYZ to access photos and media on your device?" prompt, followed by a folder picker showing the same folder structure that would come up on an Android device or emulator.
This code works as expected for Android devices and emulators.
❌ Actual Behavior
Permissions prompt does not appear and call to FolderPicker.PickAsync comes back a FolderPickerResult.object with the IsSuccessful property set to false and the Exception.Message property set to "Storage permission is not granted."
If you set the permissions via adb with the syntax like the following:
Then the folderpicker comes up in the expected folder. You are still not prompted to give the app permissions until you actually pick a folder.
Other Software
Using .NET MAUI 7 with Visual Studio 17.6.0 on Windows 11
Please specify the version of Windows Subsystem for Android
2301.40000.7.0
The text was updated successfully, but these errors were encountered: