feat(ios): add Swift Package Manager support - #1
Merged
Conversation
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>
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.
Overview
Add Swift Package Manager support on the
flutter-3.22line (home_widget 0.4.1) without upgrading to ABausG 0.9.0.Approach
SwiftPM cannot mix
.swiftand.min one target. Split:home_widget— ObjCHomeWidgetPluginshim (kept aspluginClass)home_widget_swift— Swift implementationThe ObjC shim
@importshome_widget_swiftwhenSWIFT_PACKAGEis set. The background worker callsSwiftHomeWidgetPlugin.registerdirectly so the Swift target does not depend on the ObjC target. CocoaPods still globs allSources/**.Testing and Verification
7cccba2): passKnown gaps / not verified
No upgrade to upstream 0.9.0 (intentional). Widget extension host (
MessengerWidgetsExtension) does not importhome_widget.Reviewing instructions
pluginClass: HomeWidgetPlugin.HomeWidgetBackgroundWorkermust not reference the ObjC shim.