Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Android permissions optional #1687

Closed
emersion opened this issue Sep 1, 2022 · 4 comments · Fixed by #2052
Closed

Make Android permissions optional #1687

emersion opened this issue Sep 1, 2022 · 4 comments · Fixed by #2052

Comments

@emersion
Copy link
Contributor

emersion commented Sep 1, 2022

Right now the plugin requires the app to have a bunch of permissions:

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

There is no way for applications to remove these permissions, even if they do not use features that require them. For instance, an app which only posts regular notifications does not need RECEIVE_BOOT_COMPLETED, USE_FULL_SCREEN_INTENT, nor SCHEDULE_EXACT_ALARM.

Other plugins (e.g. flutter_background, or even Flutter itself with the INTERNET permission) ask developers to manually add the permissions they need in their docs.

Would it be possible to do the same here, so that developers can remove permissions they don't need when using the plugin?

@MaikuB
Copy link
Owner

MaikuB commented Sep 3, 2022

Thanks for raising this. Actually, the setting up of permissions use to be something the plugin required each app to do. This did lead to occurrences where issues would be raised as some of the community missed this step. Moreover, this change was driven by a review from the Flutter ecosystem committee when they were evaluating the plugin for the Flutter favourites program and mentioned this would reduce friction in using the plugin. I could look at moving these out so the plugin itself isn't requesting permissions besides the bare minimum but to be safe, will check with the committee if they have concerns on this happening

@noinskit
Copy link
Contributor

noinskit commented Sep 7, 2022

FYI as a workaround, permissions merged from the plugin's AndroidManifest.xml can be removed in app's own AndroidManifest.xml like this:

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" tools:node="remove"/>

@myselfuser1
Copy link

This will help https://www.youtube.com/watch?v=aQTvI8L-mZs

@IcedNet
Copy link

IcedNet commented Jun 14, 2023

As a note, you must include the tools namespace in the manifest tag for that to work:

xmlns:tools="http://schemas.android.com/tools"

@MaikuB
Copy link
Owner

MaikuB commented Jul 16, 2023

This has been done as part of the 16.0.0 prerelease

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants