Skip to content

feat(ios): add Swift Package Manager support - #1

Merged
ik-make merged 3 commits into
flutter-3.22from
feat/ios-spm-support
Aug 25, 2026
Merged

feat(ios): add Swift Package Manager support#1
ik-make merged 3 commits into
flutter-3.22from
feat/ios-spm-support

Conversation

@ik-make

@ik-make ik-make commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Overview

Add Swift Package Manager support on the flutter-3.22 line (home_widget 0.4.1) without upgrading to ABausG 0.9.0.

Approach

SwiftPM cannot mix .swift and .m in one target. Split:

  • home_widget — ObjC HomeWidgetPlugin shim (kept as pluginClass)
  • home_widget_swift — Swift implementation

The ObjC shim @imports home_widget_swift when SWIFT_PACKAGE is set. The background worker calls SwiftHomeWidgetPlugin.register directly so the Swift target does not depend on the ObjC target. CocoaPods still globs all Sources/**.

Testing and Verification

  • MessengerX iOS build with this commit (7cccba2): pass
  • First SPM resolve failed with mixed-language error; split targets fixed it: pass
  • Example app SPM on/off: not run

Known gaps / not verified

No upgrade to upstream 0.9.0 (intentional). Widget extension host (MessengerWidgetsExtension) does not import home_widget.

Reviewing instructions

  • Keep ObjC pluginClass: HomeWidgetPlugin.
  • SwiftPM targets must stay single-language.
  • HomeWidgetBackgroundWorker must not reference the ObjC shim.

ik-make and others added 3 commits August 24, 2026 03:29
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
The ObjC HomeWidgetPlugin shim is a separate SPM target, so the Swift
worker must call SwiftHomeWidgetPlugin.register directly.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ik-make ik-make self-assigned this Aug 24, 2026
@ik-make
ik-make marked this pull request as ready for review August 25, 2026 01:49
@ik-make
ik-make merged commit fbf87ec into flutter-3.22 Aug 25, 2026
2 of 3 checks passed
@ik-make
ik-make deleted the feat/ios-spm-support branch August 25, 2026 01:49
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