Skip to content

Add swiftpmConfig.name for React Native SwiftPM autolinking - #201

Merged
balthazar merged 1 commit into
balthazar:masterfrom
chrfalch:swiftpm-config-name
Oct 29, 2026
Merged

balthazar merged 1 commit into
balthazar:masterfrom
chrfalch:swiftpm-config-name

Conversation

@chrfalch

@chrfalch chrfalch commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

The library ships a Package.swift with product ReactNativeZeroconf. React Native 0.88 SwiftPM autolinking looks for a product named react-native-zeroconf unless package.json sets swiftpmConfig.name, so the app fails at package resolution.

This adds swiftpmConfig.name to package.json to select ReactNativeZeroconf. It has no effect on CocoaPods or Android.

React Native 0.87 reads only the older spm block in react-native.config.js. This key matters from React Native 0.88 on.

Test plan:

  • Fresh React Native 0.88.0 app with react-native-zeroconf 0.17.6 from npm, with this key added to its package.json.
  • npx react-native spm add --deintegrate completed.
  • Release build for an iOS 27.1 simulator: the package resolved, BUILD SUCCEEDED. Without the key, the build fails at package resolution.
  • At runtime, new Zeroconf() succeeded. No crash.

@balthazar

Copy link
Copy Markdown
Owner

Thank you!

@balthazar
balthazar merged commit e50a920 into balthazar:master Oct 29, 2026
6 checks passed
balthazar added a commit that referenced this pull request Oct 29, 2026
…nking

React Native 0.88 takes a library's SwiftPM product name from
swiftpmConfig.name in package.json, falling back to the podspec name
(react-native-zeroconf). The manifest's product is ReactNativeZeroconf,
so the package failed to resolve. Same fix as #201 on 0.17.

Co-authored-by: Christian Falch <christian.falch@gmail.com>
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.

2 participants