Why do I need the uses-permission inside my AndroidManifest.xml when I need to request it manually anyway?
The uses-permission
in the AndroidManifest.xml is used to declare the permissions your app need. And the official document about Declaring app permissions said:
if your app requests app permissions, you must declare these permissions in your app's manifest file. These declarations help app stores and users understand the set of permissions that your app might request.
And the POST_NOTIFICATIONS
is a runtime permission. The official document about Request runtime permissions said:
If you declare any dangerous permissions, and if your app is installed on a device that runs Android 6.0 (API level 23) or higher, you must request the dangerous permissions at runtime
so why am I not getting asked over and over again?
This is because you only called the Permissions.RequestAsync<Permissions.PostNotifications>();
once. And the code executed finished after user operation. For more information, you can check the official document about App capabilities depend on user choice in permissions dialog.
But if user denies the permission more than once, the request dialog will not show any more. The official document about Handle permission denial said:
Starting in Android 11 (API level 30), if the user taps Deny for a specific permission more than once during your app's lifetime of installation on a device, the user doesn't see the system permissions dialog if your app requests that permission again. The user's action implies "don't ask again." On previous versions, users saw the system permissions dialog each time your app requested a permission, unless they had previously selected a "don't ask again" checkbox or option.