Search code examples
androidiospush-notificationpermissionsmaui

How to check if PUSH notifications are enabled for my MAUI app on the device (Android, iOS)


I am developing an application on MAUI, I use Firebase for PUSH notifications. I was wondering how on startup it is possible to check if the user has disabled notification permissions or not for Android and iOS?

I searched for information, but did not find anything specific. I would be grateful if there is any documentation or samples regarding my question

Upd: Found this article and redid the notification check with it https://dev.to/vhugogarcia/app-settings-in-net-maui-notifications-47mp


Solution

  • According to Available permissions, the Permission for Notifications hasn't been added to the Permissions in .NET MAUI.

    And there's a feature request: Permission for Notifications #12291 that being tracked in the link below, you can follow up there.

    https://github.com/dotnet/maui/issues/12291

    If the Permission for Notifications has been implemented in .NET MAUI, you probably can check the current status of it by below code:

    PermissionStatus status = await Permissions.CheckStatusAsync<Permissions.Notifications>();