Request Permission not working on Android Maui

Phunction 301 Reputation points
2025-02-26T16:44:13.4733333+00:00

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?

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,955 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.