Skip to content

feat: add Swift Package Manager support for iOS - #683

Merged
ened merged 5 commits into
mainfrom
feat/apple-spm-support
Aug 1, 2026
Merged

feat: add Swift Package Manager support for iOS#683
ened merged 5 commits into
mainfrom
feat/apple-spm-support

Conversation

@ened

@ened ened commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

Port of #674 by @bbbshah (original commits preserved, same authorship).

Completes SPM support for workmanager_apple while keeping CocoaPods working:

  • Package.swift at ios/workmanager_apple/Package.swift (Flutter detects it there)
  • Product renamed to workmanager-apple
  • PrivacyInfo.xcprivacy moved inside the SPM target with .process(...) (resource path was escaping the target root)
  • podspec source_files/resource_bundles updated so CocoaPods still builds
  • Pigeon swiftOut points at the relocated sources; .gitignore for .build//.swiftpm/

Builds on the port of #657 (fix/apple-spm-structure). Note: this relocates all workmanager_apple Swift sources — any uncommitted local edits to those files must be stashed/committed before merging.

Co-authored-by: Bhavik Shah bhavik@memreel.io

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>
@ened
ened merged commit 6578170 into main Aug 1, 2026
19 checks passed
@ened
ened deleted the feat/apple-spm-support branch August 1, 2026 11:36
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.

2 participants