Skip to content

Conversation

@fadi-george
Copy link
Collaborator

@fadi-george fadi-george commented Jan 7, 2026

Description

One Line Summary

Adds swift package manager support for the flutter sdk package.

Details

Closes #971
Follows https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors#how-to-turn-on-swift-package-manager guide for setting up spm for flutter plugins.

  • update projects to use spm which should still be compatible for cocoapods projects

Motivation

  • cocoapods support is deprecated in favor swift package manager support

Testing

Manual testing

Test step 20 for https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors#how-to-turn-on-swift-package-manager
where I disabled spm config and did flutter run in the example project

Then I re-enabled spm config and did the same thing and it still worked.

Pods:

Show pod install
Screenshot 2026-01-06 at 4 14 42 PM

SPM:

Screenshot 2026-01-06 at 4 11 15 PM

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
    • If it is hard to explain how any codes changes are related to each other then it most likely needs to be more than one PR
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
    • Simplify with less code, followed by splitting up code into well named functions and variables, followed by adding comments to the code.
  • I have reviewed this PR myself, ensuring it meets each checklist item
    • WIP (Work In Progress) is ok, but explain what is still in progress and what you would like feedback on. Start the PR title with "WIP" to indicate this.

This change is Reviewable

@fadi-george fadi-george requested a review from a team as a code owner January 7, 2026 00:03
@fadi-george fadi-george changed the title flutter: add swift package manager support ci: add swift package manager support Jan 7, 2026
@fadi-george fadi-george changed the title ci: add swift package manager support feat: add swift package manager support Jan 7, 2026
@fadi-george fadi-george changed the base branch from main to fg/flutter-spm-example January 7, 2026 00:22
Base automatically changed from fg/flutter-spm-example to main January 7, 2026 17:52
Copy link
Contributor

@nan-li nan-li left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Duplicate source files in ios/Classes/ and ios/onesignal_flutter/Sources/onesignal_flutter/. Step 8 and 9 of guide notes to remove old directory:

Move all files from ios/Classes to ios/plugin_name/Sources/plugin_name.
The ios/Assets, ios/Resources, and ios/Classes directories should now be empty and can be deleted.

  1. Info on documentation steps needed? This is the existing Flutter SDK setup: https://documentation.onesignal.com/docs/en/flutter-sdk-setup. Can you add any notes on how we would update the docs?

@fadi-george
Copy link
Collaborator Author

Seems like for NSE and live activity widget they both need to manually add OneSignalXCFramework to "Frameworks and Libraries" section

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.

[Feedback]: Add Swift Package Manager support

4 participants