feat: add Swift Package Manager support for iOS - #683
Merged
Conversation
Relocate the workmanager_apple iOS plugin into the directory layout that
Flutter's Swift Package Manager (SPM) integration detects, while keeping
full CocoaPods backward compatibility. Plugins are expected to support both
dependency managers during the transition.
- Move Package.swift to ios/workmanager_apple/Package.swift so Flutter
detects the Swift package (previously at ios/Package.swift, never found).
- Rename the library product to "workmanager-apple" (Flutter requires SwiftPM
product names without underscores).
- Move the privacy manifest into the SPM target and reference it with
.process("PrivacyInfo.xcprivacy") so the resource path stays inside the
target root.
- Update workmanager_apple.podspec source_files/resource_bundles paths to the
new location so CocoaPods builds keep working, and fix placeholder metadata.
- Add import UIKit to Extensions.swift (required under SPM's per-file modular
compilation for UIBackgroundFetchResult).
- Point the Pigeon swiftOut path at the relocated sources.
- Ignore .build/ and .swiftpm/.
Verified the example app builds under both SPM
(flutter config --enable-swift-package-manager) and CocoaPods.
Co-Authored-By: Iwan Gerber <info@ih-app.de>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Aug 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Port of #674 by @bbbshah (original commits preserved, same authorship).
Completes SPM support for
workmanager_applewhile keeping CocoaPods working:Package.swiftatios/workmanager_apple/Package.swift(Flutter detects it there)workmanager-applePrivacyInfo.xcprivacymoved inside the SPM target with.process(...)(resource path was escaping the target root)source_files/resource_bundlesupdated so CocoaPods still buildsswiftOutpoints at the relocated sources;.gitignorefor.build//.swiftpm/Builds on the port of #657 (fix/apple-spm-structure). Note: this relocates all
workmanager_appleSwift sources — any uncommitted local edits to those files must be stashed/committed before merging.Co-authored-by: Bhavik Shah bhavik@memreel.io