chore: migrate sample app to use spm#329
Conversation
- Move source files from ios/Classes/ to ios/customer_io/Sources/customer_io/ (SPM-compatible layout) - Add Package.swift for Swift Package Manager resolution - Remove ObjC bridge files (CustomerIOPlugin.h/m) - no longer needed with SPM - Rename SwiftCustomerIOPlugin -> CustomerIOPlugin - Change #if CIO_LOCATION_ENABLED to #if canImport(CioLocation) for SPM compatibility - Update podspec source_files paths to point to new location - Add import Foundation to CustomerIOSDKConfigMapper.swift - Add SPM build verification CI job - Update .gitignore for SPM build artifacts
Firebase iOS SDK requires Swift 6.0+ features (sending keyword, AccessLevelOnImport) which are only available in Xcode 16+.
Flutter's SPM integration looks for a product named 'customer_io' (matching pluginClass from pubspec.yaml). The hyphenated name 'customer-io' would cause SPM dependency resolution to fail.
The auto-update-native-sdks workflow now also updates the hardcoded iOS SDK version in Package.swift when bumping native_sdk_version in pubspec.yaml, keeping CocoaPods and SPM in sync.
Flutter's generated FlutterGeneratedPluginSwiftPackage converts underscores to hyphens when referencing plugin products. The generated Package.swift looks for 'customer-io' (not 'customer_io'), so the original hyphenated name was correct.
The plugin should not force a specific push provider. Use the base MessagingPush module (matching the podspec 'nopush' default). Customers add their specific push provider (APN/FCM) in their own Xcode project.
The plugin code does not import any MessagingPush module. Only DataPipelines and MessagingInApp are needed. Push provider (APN/FCM) is added by customers in their own Xcode project.
Building for device requires code signing even with --no-codesign when the Xcode project has manual signing configured. Simulator build avoids this and still verifies SPM dependency resolution and compilation.
Use MacOS-15+iOS-26 branch instead of main to match the existing build-ios-sample-app job.
The amiapp_flutter requires ios/Env.swift (gitignored, generated from Env.swift.example) and a .env file to compile. Also run flutter pub get before building.
Rewrite the SPM CI job to follow the same setup pattern as the existing build-ios-sample-app job: - Create .env with placeholder credentials - Copy Env.swift.example to Env.swift - Setup flutter and pub get - Setup iOS environment with matching action version - Build for simulator to avoid code signing
Sample app builds 📱Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request.
|
| flutter: | ||
|
|
||
| config: | ||
| enable-swift-package-manager: false |
There was a problem hiding this comment.
Added project level config so sample app isn't affected by global level config
| flutter: | ||
|
|
||
| config: | ||
| enable-swift-package-manager: true |
There was a problem hiding this comment.
Added project level config so sample app isn't affected by global level config
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9ac3201. Configure here.
9ac3201 to
ab785be
Compare
There was a problem hiding this comment.
SPM bumps firebase_core to ^4.6.0 and firebase_messaging to ^16.1.3, we should probably update here too?
There was a problem hiding this comment.
That's required for SPM support, will do that later in separate PR for pods sample

closes: MBL-1614
Summary
FlutterGeneratedPluginSwiftPackageto NSE target for Customer.io push dependencies via SPMfirebase_coreto^4.6.0andfirebase_messagingto^16.1.3(required for Flutter SPM support)enable-swift-package-manager: truefor SPM app andfalsefor CocoaPods app inpubspec.yamlimport UserNotificationsto NSE (required for SPM builds)apps/README.mdwith iOS dependency management detailsHow it works
DataPipelines,MessagingInApp,Location,MessagingPushFCM,CioFirebaseWrapper) are automatically resolved via the plugin's Package.swift through Flutter's SPM integrationFlutterGeneratedPluginSwiftPackageto access CIO push dependencies, no separate package neededpubspec.yamlconfigTest plan
flutter build ios --simulator --debug)flutter build apk)Note
Medium Risk
Medium risk because it changes iOS build/dependency wiring (CocoaPods vs SPM) and updates Firebase package major versions, which can break CI or sample app builds if any plugin integration differs between environments.
Overview
Migrates the
flutter_sample_spmiOS sample app to resolve Customer.io dependencies via Swift Package Manager instead of explicit CocoaPods wiring, including linkingFlutterGeneratedPluginSwiftPackageinto the Notification Service Extension and removing Pod-based extension/framework embed steps.Updates CI to explicitly enable SPM for the SPM sample app, adds per-app
pubspec.yamlenable-swift-package-managerflags (SPM app true, CocoaPods app false), bumpsfirebase_core/firebase_messagingto SPM-compatible major versions, and refreshes docs to describe the two iOS dependency management modes.Reviewed by Cursor Bugbot for commit 6bc2363. Bugbot is set up for automated code reviews on this repo. Configure here.