Request Permission not working on Android Maui
I am having an issue requesting storage read/write permissions. I have them Selected in the manifest file.
Onappearing I have:
PermissionStatus nWritePermission = await GP.CheckAndRequestStorageWritePermission();
The method is:
public async Task<PermissionStatus> CheckAndRequestStorageWritePermission()
{
PermissionStatus status = await Permissions.CheckStatusAsync<Permissions.StorageWrite>();
if (status == PermissionStatus.Granted)
return status;
if (status == PermissionStatus.Denied && DeviceInfo.Platform == DevicePlatform.iOS)
{
// Prompt the user to turn on in settings
// On iOS once a permission has been denied it may not be requested again from the application
return status;
}
if (Permissions.ShouldShowRationale<Permissions.StorageWrite>())
{
// Prompt the user with additional information as to why the permission is needed
}
status = await Permissions.RequestAsync<Permissions.StorageWrite>();
return status;
}
The read is the same. The method is called, but I don't get the popup asking for the permission. I tried putting it on a timed loop to have it ask the permission again (running on ui thread) but it does not come up.
The strange part is that is was working, then I un-installed the app on the device and re-installed it and now it won't ask permissions.
When I look at the app properties in settings, it says no permissions are required by the app and none are given?