feat(ios): add Swift Package Manager support#144
Open
nurlangarash wants to merge 1 commit into
Open
Conversation
Adds a Package.swift manifest alongside the existing podspec so the plugin builds with Flutter 3.44+ Swift Package Manager while remaining fully CocoaPods-compatible. - Move ios/Classes -> ios/superwallkit_flutter/Sources/superwallkit_flutter (shared source tree consumed by both SPM and CocoaPods) - Add ios/superwallkit_flutter/Package.swift (iOS 14.0), depending on the SuperwallKit SPM package (github.com/superwall/Superwall-iOS) pinned to 4.14.2 to match the podspec - Update podspec source_files to the new shared path - Ignore SPM build artifacts Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
Summary
Adds a
Package.swiftmanifest alongside the existing podspec sosuperwallkit_flutterbuilds with Flutter 3.44+ Swift Package Manager (SPM) while remaining fully CocoaPods-compatible.Under Flutter 3.44+ the plugin currently emits:
This PR removes that warning. CocoaPods is not removed — both dependency managers consume the same source tree during the transition (CocoaPods becomes read-only on 2 Dec 2026).
Changes
ios/Classes/→ios/superwallkit_flutter/Sources/superwallkit_flutter/(shared source tree used by both SPM and CocoaPods). All moves aregit mvrenames, so history is preserved.ios/superwallkit_flutter/Package.swift:swift-tools-version: 5.9, platformiOS 14.0(matches the podspec floor).github.com/superwall/Superwall-iOS), pinnedexact: "4.14.2"to matchs.dependency 'SuperwallKit', '4.14.2'.dependencies: []for Flutter itself — the engine is injected automatically by the SPM build; noFlutterpackage is declared).ios/superwallkit_flutter.podspecsource_filesto the new shared path..build/,.swiftpm/,Package.resolved).The plugin is 100% Swift and uses Pigeon, so no Objective-C umbrella/header handling is needed — the Pigeon-generated
SuperwallHostGenerated.swiftsimply moves with the other sources.Reference
Followed the official Flutter guide for plugin authors: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors, cross-checked against the SPM manifests in
flutter/packages(e.g.url_launcher_ios,shared_preferences_foundation).Testing status
Happy to adjust the platform floor, version pin (e.g.
.upToNextMajor(from: "4.0.0")), or layout to match your preferences.