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

🐛 Add Swift Package Manager support #13205

Closed
loic-sharma opened this issue Aug 21, 2024 · 7 comments · Fixed by #16856
Closed

🐛 Add Swift Package Manager support #13205

loic-sharma opened this issue Aug 21, 2024 · 7 comments · Fixed by #16856
Labels
platform: ios Issues / PRs which are specifically for iOS. plugin: core type: enhancement New feature or request

Comments

@loic-sharma
Copy link
Contributor

Hello,

Flutter is migrating to Swift Package Manager. Please add Swift Package Manager support to your plugin.

Flutter will eventually deprecate and then remove support for CocoaPods. Adding Swift Package Manager support future-proofs your plugins.

How to add Swift Package Manager support to your plugins

You can find the migration guide here: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors#how-to-add-swift-package-manager-support-to-an-existing-flutter-plugin

If you run into issues or have questions, please reach out to the Flutter team. You can ping me at @loic-sharma, send a message to the #hackers-ios channel on Flutter’s discord, or open a GitHub issue.

Thank you for your wonderful contributions to the Flutter ecosystem!

Why is Flutter migrating to Swift Package Manager?

CocoaPods is now in maintenance mode.

Swift Package Manager support is one of Flutter’s most requested features: flutter#33850.

Flutter's Swift Package Manager integration has several benefits:

  1. Access to the Swift package ecosystem. Flutter plugins can use the growing ecosystem of Swift packages.
  2. Simplifies Flutter installation. Swift Package Manager is bundled with Xcode. In the future, you won’t need to install Ruby and CocoaPods to target iOS or macOS.
@loic-sharma loic-sharma added Needs Attention This issue needs maintainer attention. type: enhancement New feature or request labels Aug 21, 2024
@loic-sharma
Copy link
Contributor Author

Pull request to update firebase_core is here: #12786

@SelaseKay SelaseKay added platform: ios Issues / PRs which are specifically for iOS. plugin: core labels Aug 22, 2024
@charafau
Copy link
Contributor

firestore: #13329

@SelaseKay SelaseKay added resolution: fixed A fix has been merged or is pending merge from a PR. and removed resolution: fixed A fix has been merged or is pending merge from a PR. labels Oct 9, 2024
@SelaseKay SelaseKay reopened this Oct 9, 2024
@Gustl22
Copy link
Contributor

Gustl22 commented Nov 28, 2024

@russellwheatley I saw you recently added a bunch of PRs regarding SPM. Are you also currently working on firebase_messaging? Otherwise I'll try to start making a PR? Thanks, and best regards.

I created #16786

@russellwheatley
Copy link
Member

@Gustl22 - much appreciated 🙏

@russellwheatley
Copy link
Member

Hey @loic-sharma - I'm trying to port over app installations plugin to Swift integration. This plugin is slightly different as it contains Swift and Objective-c source code. This is a problem because you cannot mix different languages in same target AFAIK. Therefore, I've separated the source code and put into two different targets.

Here is what I've done in the Package.swift: https://github.com/firebase/flutterfire/pull/16814/files#diff-edea417c9f367770f068c480012a27a623d686b5cc017f5d331837cd4e261e2eR97-R123

I've tried importing the generated swift header file like so: https://github.com/firebase/flutterfire/pull/16814/files#diff-92d2e67c7bae825b709e7dc6f0c02b7b0545ecbfc988295fc160773245a3307bR12

but it cannot find it. It seems the file is generated in the derived data. Don't suppose there are instructions for handling this in Flutter or if you have any ideas on how to resolve this?

russellwheatley added a commit that referenced this issue Dec 6, 2024
russellwheatley added a commit that referenced this issue Dec 6, 2024
@russellwheatley
Copy link
Member

russellwheatley commented Dec 6, 2024

Plugins with Swift Package Manager support:

  • firestore
  • analytics
  • core
  • auth
  • real time database
  • remote config
  • storage
  • messaging
  • app check
  • crashlytics
  • app installations
  • dynamic links
  • performance
  • model downloader
  • in app messaging

@charafau
Copy link
Contributor

@russellwheatley wow, good job!

@firebase firebase locked and limited conversation to collaborators Jan 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform: ios Issues / PRs which are specifically for iOS. plugin: core type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants