-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Plugin: Runtime permissions checks for Android and iOS #685
Comments
@sethladd @abarth is there any work here? As far as I understand it, this is transparent to the app. You simply request permissions in the manifest and code, and the OS takes it from there? https://developer.android.com/training/permissions/requesting.html#perm-check |
Would the UI ever need to determine if a permission has been granted yet (or not) ? For example, would I want to show UI screen A or B if a permission has been granted ? |
Yes, good catch. The UI is actually expected to do that (as the user may decline the permission, and the app is expected to deal with that), e.g.:
|
From discussion today this is a documentation gap, not a framework gap. We should document that if a plugin needs a certain permission x, then best practice is to offer hasPermissionX method in the Dart API of the plugin. |
My understanding from @lukef was the permission dance on iOS and Android were a non-trivial amount of code. So much so he was considering writing a flutter plugin to help with such? |
I'm not sure I understand. The there are many different checks, so the actual checks would need to be placed where the native code under those checks is located. @lukef can you elaborate? |
It's not clear what is being requested here. @mit-mit If there's something we should document, can you file a bug specifically saying what should be documented? Thanks! |
We have an early stage plugin here: https://github.com/goposse/permit. It is NOT ready for any kind of integration into an app of any kind, but it will support common permission on iOS and Android. We decouple the permissions from the feature as it is generally impossible to integrate the two and have acceptable UX. I'll let you know when it is refactored and ready for review. |
The goposse/permit library is no longer maintained. Other than forking it (I'm a beginner with Dart, won't know what I'm doing), what alternatives are there? |
You can look at the permit code as a good starting point however, you should definitely invest in an understanding of how the permissions work on iOS and Android as they are system level requirements and they can change from time to time. Some plugins will implement permissions directly as well so you could check to see if there is a plugin that you can use that will provide that feature also. |
Thanks @lukef, I'll invest time in understanding permissions, I'm concerned with Android for now, so I'll spend time there first |
Feel free to leave a question on stack overflow as well. That way I (or someone else) can answer and other people who might get stuck can benefit! |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Android M, and iOS, both have a concept of runtime permissions. A customer asked if this was possible to use inside of Flutter.
The text was updated successfully, but these errors were encountered: