Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions docs/platform-integration/appmodel/permissions.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Permissions"
description: "Learn how to use the .NET MAUI Permissions class, to check and request permissions. This class is in the Microsoft.Maui.ApplicationModel namespace."
ms.date: 10/28/2024
ms.date: 07/11/2025
no-loc: ["Microsoft.Maui", "Microsoft.Maui.ApplicationModel"]
---

Expand Down Expand Up @@ -36,7 +36,7 @@ The following table uses ✔️ to indicate that the permission is supported and
| [Phone](xref:Microsoft.Maui.ApplicationModel.Permissions.Phone) | ✔️ | ✔️ | ❌ | ❌ |
| [Photos](xref:Microsoft.Maui.ApplicationModel.Permissions.Photos) | ❌ | ✔️ | ❌ | ✔️ |
| [PhotosAddOnly](xref:Microsoft.Maui.ApplicationModel.Permissions.PhotosAddOnly) | ❌ | ✔️ | ❌ | ✔️ |
| [PostNotifications](xref:Microsoft.Maui.ApplicationModel.Permissions.PostNotifications) | ✔️ | | ❌ | ❌ |
| [PostNotifications](xref:Microsoft.Maui.ApplicationModel.Permissions.PostNotifications) | ✔️ | ✔️ | ❌ | ❌ |
| [Reminders](xref:Microsoft.Maui.ApplicationModel.Permissions.Reminders) | ❌ | ✔️ | ❌ | ❌ |
| [Sensors](xref:Microsoft.Maui.ApplicationModel.Permissions.Sensors) | ✔️ | ✔️ | ❌ | ❌ |
| [Sms](xref:Microsoft.Maui.ApplicationModel.Permissions.Sms) | ✔️ | ✔️ | ❌ | ❌ |
Expand All @@ -50,6 +50,13 @@ The following table uses ✔️ to indicate that the permission is supported and

If a permission is marked as ❌, it will always return <xref:Microsoft.Maui.ApplicationModel.PermissionStatus.Granted> when checked or requested.

:::moniker range=">=net-maui-11.0"

> [!NOTE]
> Starting with .NET MAUI in .NET 11, `PostNotifications` is also supported on iOS and Mac Catalyst. On Apple platforms, this permission uses `UNUserNotificationCenter.RequestAuthorization` to request notification authorization from the user. Unlike most iOS permissions, `PostNotifications` does not require an `Info.plist` usage description string.

:::moniker-end

## Checking permissions

To check the current status of a permission, use the <xref:Microsoft.Maui.ApplicationModel.Permissions.CheckStatusAsync%2A?displayProperty=nameWithType> method along with the specific permission to get the status for. The following example checks the status of the [`LocationWhenInUse`](xref:Microsoft.Maui.ApplicationModel.Permissions.LocationWhenInUse) permission:
Expand Down Expand Up @@ -95,6 +102,20 @@ A <xref:Microsoft.Maui.ApplicationModel.PermissionException> is thrown if the re
> [!IMPORTANT]
> On some platforms, a permission request can only be activated a single time. Further prompts must be handled by the developer to check if a permission is in the <xref:Microsoft.Maui.ApplicationModel.PermissionStatus.Denied> state, and then ask the user to manually turn it on.

:::moniker range=">=net-maui-11.0"

### Requesting notification permissions

To request notification posting permissions on Android, iOS, and Mac Catalyst, use the [`PostNotifications`](xref:Microsoft.Maui.ApplicationModel.Permissions.PostNotifications) permission:

```csharp
var status = await Permissions.RequestAsync<Permissions.PostNotifications>();
```

On Android, this maps to the `POST_NOTIFICATIONS` manifest permission. On iOS and Mac Catalyst, this uses `UNUserNotificationCenter.RequestAuthorization` to request notification authorization from the user. If the user has previously denied the notification permission on iOS, the method returns <xref:Microsoft.Maui.ApplicationModel.PermissionStatus.Denied> and the user must enable notifications manually through the Settings app.

:::moniker-end

## Explain why permission is needed

It's best practice to explain to your user why your application needs a specific permission. On iOS, you must specify a string that is displayed to the user. Android doesn't have this ability, and also defaults permission status to <xref:Microsoft.Maui.ApplicationModel.PermissionStatus.Disabled>. This limits the ability to know if the user denied the permission or if it's the first time the permission is being requested. The <xref:Microsoft.Maui.ApplicationModel.Permissions.ShouldShowRationale%2A> method can be used to determine if an informative UI should be displayed. If the method returns `true`, this is because the user has denied or disabled the permission in the past. Other platforms always return `false` when calling this method.
Expand Down
Loading