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

[Enhancement proposal]: [WIP] Add Swift Package Manager support #1439

Open
3 of 5 tasks
engels-all-win-software opened this issue Feb 3, 2025 · 0 comments
Open
3 of 5 tasks

Comments

@engels-all-win-software
Copy link

Please check the following before submitting a new issue.

Please select affected platform(s)

  • Android
  • iOS
  • Windows

Proposal

This issue aims to track the progress of implementing SPM support within permission handler

This SPM implementation is still in development due to differences between CocoaPods and SPM. Preprocessor macros in Swift Package Manager require additional work to streamline the process of defining permissions, similar to how we did it in the Podfile.

This implementation maintains CocoaPods alongside SPM, and the example app uses CocoaPods. To use the SPM integration, simply remove the Podfile and execute pod deintegrate. Then, enable SPM support and run the app again.

Image

I would like to coordinate with the team and ask if there's an easy or ideal way to implement the preprocessor macros so these changes won't negatively affect the developer experience. Since Swift Package Traits are still a work in progress and it's uncertain whether the feature will be implemented in Swift, we need to explore alternative solutions in the meantime.

I've taken the approach of activating permission modules through environment variables, similar to what's mentioned here: Conditionally compile code in a Flutter plugin using Swift Package Manager. This simplifies the process. One useful option is creating an xcconfig file that can be imported into the Release or Debug xcconfig files. This file would contain the desired permissions declared as variables. This would be a one-time setup and wouldn't require exporting those variables each time the app is run.

Here are some useful links with additional information:

Pitch

Implementing Swift Package Manager support will improve the developer experience and keep us in sync with the latest Flutter upstream changes.

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

No branches or pull requests

1 participant