Repository navigation
feat(ios): add Swift Package Manager support - #919
Merged
Merged
Conversation
sboily
approved these changes
Nov 16, 2026
sboily
left a comment
Member
There was a problem hiding this comment.
Thanks for this! I checked it with React Native 0.88.1 and Xcode 27, on the iOS 27 simulator:
- Without this PR,
npx react-native spm add --deintegrate --yesfails withPackage.swift is missing for library "react-native-callkeep". With it, the autolinker uses the manifest (Self-managed: RNCallKeep), and the Debug and Release builds succeed. - A Swift scene delegate can
import RNCallKeepwithout a bridging header, as our iOS docs show.RNCallKeep.isCallActiveandRNCallKeep.continueUserActivitycompile, and at launch the Release app'sisCallActivecall returnsfalse. From JavaScript,isCallActiveresolvesfalsetoo. - The app's
RNCallKeep_RNCallKeep.bundleholds the privacy manifest, byte-identical toios/PrivacyInfo.xcprivacy. RNCallKeep.mis compiled withDEBUG=1in Debug and without it in Release, as with CocoaPods, so CallKeep's debug logging doesn't change.- For CocoaPods,
pod ipc specgives the same JSON as 4.6.1.
I'll add the changelog entry and a SwiftPM section to the iOS installation docs in a follow-up.
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
React Native 0.88 can build iOS libraries with Swift Package Manager (SwiftPM) instead of CocoaPods. react-native-callkeep has no
Package.swift, so apps that use SwiftPM cannot use it.This PR adds SwiftPM support. CocoaPods users see no change, and no source file changes.
Package.swift: the manifest that React Native's SwiftPM autolinking uses. It buildsios/RNCallKeepand definesRCT_NEW_ARCH_ENABLED=1, as React Native's SwiftPM library manifests do. The callkeep sources do not read this define. It bundlesios/PrivacyInfo.xcprivacyas a resource, as the podspec'sresource_bundlesdoes.include/RNCallKeep/RNCallKeep.h: a one-line public header that re-exportsios/RNCallKeep/RNCallKeep.h. App code can keep#import <RNCallKeep/RNCallKeep.h>, for example for setup from native code.package.json: the Swift package name (swiftpmConfig.name,RNCallKeep, the same as the podspec). The package has nofileslist, so npm already ships the new files.Would you like SwiftPM support in this library? I am glad to change the approach.
Test plan
npx react-native spm add --deintegrate --yes, with react-native-callkeep from this branch.spm addfails:Package.swift is missing for library "react-native-callkeep".xcodebuildDebug and Release, iOS simulator: both BUILD SUCCEEDED. The app's SwiftAppDelegatecallsRNCallKeep.isCallActivethrough a bridging header with#import <RNCallKeep/RNCallKeep.h>.PrivacyInfo.xcprivacyin theRNCallKeep_RNCallKeep.bundleresource bundle, byte-identical toios/PrivacyInfo.xcprivacy.RNCallKeep.isCallActivewith an unknown call UUID, and the native module returnsfalse.npm run checkpasses, andnpm packincludesPackage.swiftandinclude/RNCallKeep/RNCallKeep.h.import RNCallKeepwithout a bridging header.