Add Swift Package Manager support for iOS#35
Open
maclt wants to merge 1 commit intorefiner-io:mainfrom
Open
Conversation
Adds a Package.swift next to the existing podspec so the plugin can be consumed via SPM (Flutter 3.24+) while keeping CocoaPods compatibility. Mirrors the layout used by Flutter's first-party plugins (e.g. url_launcher_ios). - Move ios/Classes/RefinerFlutterPlugin.swift to ios/refiner_flutter/Sources/refiner_flutter/ (Flutter SPM convention) - Add ios/refiner_flutter/Package.swift depending on https://github.com/refiner-io/mobile-sdk-ios.git (from: 1.7.1) as a static library product, iOS 12.0 - Repoint s.source_files in the podspec; deps, static_framework, and swift_version unchanged - Bump pubspec to 1.9.0; raise floors to Dart >=3.5.0 and Flutter >=3.24.0 - Document both install paths in README; add 1.9.0 entry to CHANGELOG - Ignore .build/ and .swiftpm/ in ios/.gitignore Refs: refiner-io#34
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.
What it does
Adds Swift Package Manager (SPM) support for the iOS plugin while keeping CocoaPods compatibility. Apps on Flutter 3.24+ with SPM enabled can now consume
refiner_flutterwithoutpod install. Apps on the legacy CocoaPods path keep working unchanged. Mirrors Flutter's first-party plugin layout (e.g.url_launcher_ios).Changes
ios/refiner_flutter/Package.swift— declares therefiner_flutterSPM package, depends onhttps://github.com/refiner-io/mobile-sdk-ios.git(from: 1.7.1), productrefiner-flutterstatic library, iOS 12.0ios/Classes/RefinerFlutterPlugin.swift→ios/refiner_flutter/Sources/refiner_flutter/RefinerFlutterPlugin.swift(Flutter SPM convention; same file builds under both systems)ios/refiner_flutter.podspec—s.source_filesrepointed to the new path; everything else unchangedpubspec.yamlto1.9.0, Dart>=3.5.0, Flutter>=3.24.0example/pubspec.yamlDart floor to>=3.5.0CHANGELOG.md1.9.0 entry;README.mdiOS install section now covers both SPM and CocoaPods.build/and.swiftpm/added toios/.gitignoreThe Swift source itself was not edited.
How to test it
cd exampleflutter config --no-enable-swift-package-managerrm -rf ios/Pods ios/Podfile.lock && flutter clean && flutter pub getflutter build ios --simulator --no-codesign— should build greenflutter config --enable-swift-package-managerflutter clean && flutter pub getflutter build ios --simulator --no-codesign— should build green; expectAdding Swift Package Manager integration...stepRefiner.initialize,Refiner.identifyUser,Refiner.trackEvent, and confirm a survey campaign firespod lib lint ios/refiner_flutter.podspec --quick --allow-warnings— should passVerified locally on Flutter 3.35.6 + Xcode 26: both build paths green,
pod lib lintpasses with the same pre-existing warnings (no new ones).Link to ticket
#34