Skip to content

feat(ios): add Swift Package Manager support#8

Merged
ppamorim merged 2 commits intomasterfrom
feature/swiftpm
Apr 17, 2026
Merged

feat(ios): add Swift Package Manager support#8
ppamorim merged 2 commits intomasterfrom
feature/swiftpm

Conversation

@ppamorim
Copy link
Copy Markdown

Summary

  • Adds Swift Package Manager (SPM) support to the iOS plugin, following the official Flutter migration guide
  • Moves iOS source files from ios/Classes/ to ios/flutter_foreground_task/Sources/flutter_foreground_task/ (SPM-compliant layout)
  • Creates Package.swift manifest targeting iOS 12.0+ with ObjC bridge files excluded from the SPM target
  • Updates the CocoaPods podspec source_files to point to the new paths, maintaining dual CocoaPods + SPM compatibility
  • Adds .build/ and .swiftpm/ to .gitignore

Addresses Dev-hwang/flutter_foreground_task#379 — Flutter is making SPM the default in the next stable release (3.44), and CocoaPods is now in maintenance mode.

Test plan

  • Verify CocoaPods still works: flutter config --no-enable-swift-package-manager && cd example && flutter run
  • Verify SPM works: flutter config --enable-swift-package-manager && cd example && flutter run
  • Open ios/flutter_foreground_task/ in Xcode and confirm Package.swift resolves without errors
  • Run existing unit tests: flutter test

Flutter is migrating to Swift Package Manager (SPM) as the default
dependency manager for iOS. This adds SPM support while keeping
CocoaPods compatibility, following the official migration guide.

- Create ios/flutter_foreground_task/ SPM package with Package.swift
- Move source files from ios/Classes/ to SPM-compliant directory layout
- Update podspec source_files to point to the new paths
- Add .build/ and .swiftpm/ to .gitignore

Closes Dev-hwang#379
Aligns the CocoaPods deployment target with Package.swift and
Flutter 3.22+'s own iOS 12.0 minimum requirement.
@sonarqubecloud
Copy link
Copy Markdown

@ppamorim ppamorim merged commit d932c4f into master Apr 17, 2026
2 checks passed
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

Successfully merging this pull request may close these issues.

1 participant