Repository navigation
feat: [SDK-5818] add Package.swift for React Native SPM mode (1/4) - #2018
Merged
Merged
Conversation
Ship a Swift package manifest so apps using React Native's Swift Package Manager mode can link the SDK and OneSignal-XCFramework. Location is omitted when ONESIGNAL_DISABLE_LOCATION is set, matching the podspec. The release workflow bumps the XCFramework pin in both files, and a test keeps them in sync. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 20, 2026
sherwinski
approved these changes
Nov 20, 2026
…on CI note Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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.
Description
One Line Summary
Ship a
Package.swiftso apps using React Native's Swift Package Manager mode can link the SDK andOneSignal-XCFramework.Details
Motivation
CocoaPods trunk goes read-only on Dec 2, and RN 0.89 plans to make SPM the default. Without a manifest,
npx react-native spm addfails withPackage.swift is missing for library "react-native-onesignal", and RN'sspm scaffoldcan't generate theOneSignal-XCFrameworkdependency. Fixes #2016.Scope
ios/RCTOneSignal, depending on RN's generated header packages andOneSignalFramework+OneSignalInAppMessages(+OneSignalLocationunlessONESIGNAL_DISABLE_LOCATIONis set, matching the podspec, Capacitor, and Flutter).OneSignal-XCFrameworkpinnedexactto the podspec version; the release workflow now bumps both.swiftpmConfig.nameinpackage.json, andPackage.swiftadded tofiles.Stack
demo-podsappTesting
Unit testing
__tests__/packageSwift.test.tsfails if the XCFramework pin drifts from the podspec orswiftpmConfig.namedoesn't match the product. CI doesn't build the manifest otherwise; PR 4 adds a build job.Manual testing
Fresh RN 0.88.1 app with the SDK installed from an
npm packtarball:spm add --deintegratepicked up the package; Debug, Release, andONESIGNAL_DISABLE_LOCATION=truebuilds succeeded (noOneSignalLocation.frameworkin the last). Runtime tested through the SPM demo in PR 4 on an iOS 27 simulator: fresh install, user and push subscription created, login round-trip.Affected code checklist
Checklist
Overview
Testing
Final pass
🤖 Generated with Claude Code