Skip to content

fix(workmanager_apple): Correct SPM structure and product name for Flutter compatibility - #680

Closed
ened wants to merge 2 commits into
mainfrom
fix/apple-spm-structure
Closed

fix(workmanager_apple): Correct SPM structure and product name for Flutter compatibility#680
ened wants to merge 2 commits into
mainfrom
fix/apple-spm-structure

Conversation

@ened

@ened ened commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

Port of #657 by @IwO30 (original commits preserved, same authorship).

Fixes SPM integration with Flutter tooling:

  • Package.swift lives at ios/workmanager_apple/Package.swift (Flutter only detects Swift packages at ios/<plugin_name>/)
  • Product renamed workmanager_appleworkmanager-apple (Flutter requires no underscores)
  • Added missing import UIKit in Extensions.swift (per-file modular compilation under SPM)

Co-authored-by: Iwan Gerber info@ih-app.de

…utter compatibility

- Move Package.swift to ios/workmanager_apple/ subdirectory (Flutter SPM requirement)
- Rename product from 'workmanager_apple' to 'workmanager-apple' (Flutter naming convention)
- Add missing UIKit import in Extensions.swift for UIBackgroundFetchResult
- Move Sources, Resources, Assets to correct subdirectory

This fixes Swift Package Manager integration with Flutter's SPM plugin system,
which expects:
1. Package.swift at ios/<plugin_name>/Package.swift
2. Product names with hyphens (e.g., 'workmanager-apple' not 'workmanager_apple')

Without these fixes, Flutter falls back to CocoaPods instead of using SPM.
@ened

ened commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #683: this branch moves the sources but leaves the podspec pointing at the old path, which breaks the CocoaPods build (verified failing). #683 contains the complete change (structure move + podspec path update + SPM package + optional Pods xcconfig includes) and is green. Closing this one to keep main green.

@ened ened closed this Aug 1, 2026
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