Skip to content

Fix: Add POST_NOTIFICATIONS permission#1740

Closed
Rakibul25 wants to merge 1 commit into
Baseflow:mainfrom
Rakibul25:main
Closed

Fix: Add POST_NOTIFICATIONS permission#1740
Rakibul25 wants to merge 1 commit into
Baseflow:mainfrom
Rakibul25:main

Conversation

@Rakibul25

Copy link
Copy Markdown

This PR adds the 'android.permission.POST_NOTIFICATIONS' permission to the Android manifest. This is required for apps targeting API 33 (Android 13) and above to use NotificationManagerCompat.notify without build failures related to missing permissions.

@mvanbeusekom

Copy link
Copy Markdown
Member

Hi @Rakibul25,

We prefer not to add permissions to the AndroidManifest.xml file of the plugin it self. As these permissions will be merged into the AndroidManifest.xml file of the consuming app. Meaning that apps the use the permission_handler but don't require the POST_NOTIFICATION permission will end up having it declared in their final AndroidManifest.xml file after compilation.

This should be an explicit choice of the app developer and therefore the app developer should manually add the permission to the AndroidManifest.xml file associated with their application.

@Rakibul25

Copy link
Copy Markdown
Author

Thank you for the clear explanation regarding plugin-level permissions. I completely understand and agree that it makes sense to keep permission declarations explicitly at the app level.
For clarity to other users, it's worth highlighting that developers will encounter build failures or runtime issues related to POST_NOTIFICATIONS if foreground services trigger notifications. They'll need to manually add to their app's AndroidManifest.xml and handle runtime permission requests. I've seen many users encountering "panic-inducing" lint errors during Gradle builds due to this.
Given this, I agree the solution lies with the app developer. You can close this issue. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants