flutter-permission-handler
flutter-permission-handler copied to clipboard
Added macOS implementation
:sparkles: What kind of change does this PR introduce? (Bug fix, feature, docs update...)
This PR adds the macOS implementation of the plugin.
:arrow_heading_down: What is the current behavior?
Currently it doesn't support macOS.
:new: What is the new behavior (if this is a feature change)?
Now it supports macOS permissions.
:boom: Does this PR introduce a breaking change?
No.
:bug: Recommendations for testing
A couple of entitlements won't work as there's no equivalent to be found in macOS. Some features work only from macOS 10.12, which is the minimum version that Flutter supports.
:memo: Links to relevant issues/docs
No.
:thinking: Checklist before submitting
- [ x] I made sure all projects build.
- [ ] I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
- [ ] I updated CHANGELOG.md to add a description of the change.
- [ x] I followed the style guide lines (code style guide).
- [ x] I updated the relevant documentation.
- [ ] I rebased onto current
master
.
Codecov Report
Base: 100.00% // Head: 100.00% // No change to project coverage :thumbsup:
Coverage data is based on head (
4dc8d3f
) compared to base (2e47f05
). Patch has no changes to coverable lines.
Additional details and impacted files
@@ Coverage Diff @@
## master #946 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 16 16
=========================================
Hits 16 16
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Hello, Do you have some news about macOS permission handler and this PR ? Thx
Is it possible to add feature to request full disk access?
me also waiting for this pr ,, mac os permissions is a necessary for any flutter app that is looking to support macOS platform so I think it should be a priority .
Would also appreciate this a lot.
Until this is merged, you can use:
permission_handler:
git:
url: https://github.com/bvoq/flutter-permission-handler.git
path: permission_handler
ref: master
I also vote for this feature!
Hi @riccardo-lomazzi,
First of all, apologies for the very late reply. Due to shifting priorities and under staffing we unfortunately had to postpone our work on the open source plugins. Luckily we have resolved the staffing issue and made the open source plugins a high priority.
I really appreciate the effort put into this PR and I am hoping you would be able to make some changes so the macOS support for the permission_handler is inline with support for other plugins we host (e.g. https://github.com/baseflow/flutter-geolocator). The two major request would be to:
- Create the macOS project as an Objective-C project instead of using the Swift language. We are aware Swift is a more developer friendly language, however by adding Swift to the project now adds another language to the project that developers need to understand and maintain. Since the iOS version is fully coded in Objective-C we'd prefer the macOS support to also be written in Objective-C.
- Currently most of the code is duplicated between the iOS and the macOS project. For the geolocator project we use sym-links in the macOS project reusing the source code files from the iOS project in the macOS project. This way we only have to maintain the code in one place. Use preprocessor directives to add iOS or macOS specific code blocks:
#if TARGET_OS_OSX #import <FlutterMacOS/FlutterMacOS.h> #else #import <Flutter/Flutter.h> #endif
Please let me know if you are up for bringing this PR to a point we can merge it into the main repository. If not we would be happy to take over the PR and apply the necessary changes.
Hello @mvanbeusekom
the work I did here was barebones since I was required to implement these permissions in a company's project.
The reason I chose Swift was because
- I lack experience in Obj-C
- macOS Flutter plugins require Swift as the main language
I naively thought that I could help other people by sharing this PR, but I'm realising that most of the changes I did were a bit rough.
Right now I lack the time and the experience to do the work requested, so if you could please take in charge the PR it would be great.
Thank you.
This PR seems to aim to close #337.
Please, push this feature. 🙏🏼
@bvoq are you able to update your README? i tried to add it in my pubspec.yaml but it seems it's not properly installed coz it's not found when i imported it.
@hpelitebook745G2 It works fine if you import it directly via Github using the method I described above. You won't be able to download the plugin and use it offline without making some small changes. If you want to host it yourself, you will have to change all the pubspec.yaml
references, see: https://github.com/riccardo-lomazzi/flutter-permission-handler/compare/master...bvoq:flutter-permission-handler:master.
Any updates?