Skip to content

Add experimental Swift Package Manager support; CocoaPods :git note - #91

Merged
tekinalper merged 3 commits into
developfrom
feature/spm-support
Nov 2, 2026
Merged

tekinalper merged 3 commits into
developfrom
feature/spm-support

Conversation

@tekinalper

@tekinalper tekinalper commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

What it does

  • Adds a hand-authored Package.swift for React Native's experimental SwiftPM integration (React Native 0.88+, opt-in via npx react-native spm). SwiftPM does not allow Swift and Objective-C in one target, so the manifest has two targets — RNRefinerObjC (the RCT_EXTERN_MODULE bridge in RNRefiner.m) and RNRefiner (RNRefiner.swift, MapUtil.swift, depends on RefinerSDK from https://github.com/refiner-io/mobile-sdk-ios) — exposed as a single RNRefiner product. Modelled on the manifest RevenueCat merged for react-native-purchases.
  • package.json: swiftpmConfig.name = "RNRefiner" (matches the existing module/header prefix) and Package.swift in files.
  • update-native-sdk.yml bumps the RefinerSDK range in Package.swift alongside the podspec.
  • README: CocoaPods users add pod 'RefinerSDK', :git => 'https://github.com/refiner-io/mobile-sdk-ios.git', :tag => '<version>' (RefinerSDK is no longer pushed to the CocoaPods trunk); new experimental SwiftPM section.

CocoaPods remains the default, fully supported path; nothing changes for existing integrations beyond the Podfile line once 2.x ships.

Verified (2026-11-02) in a fresh React Native 0.88.1 app: npx react-native spm add --deintegrate autolinked the package (libs/RNRefiner), the graph resolved RefinerSDK 2.0.0 from GitHub, both targets compiled, the app built for the simulator and launched. CocoaPods path verified with pod install in example/ (RN 0.79.7) using the Podfile :git/:tag line; the stale Podfile.lock (pinned 1.7.1) is removed in this PR.

How to test it

  1. swift package describe from a copy of this repo placed at <app>/ios/build/generated/autolinking/libs/RNRefiner (with the autolinker's xcframeworks package present) lists both targets.
  2. In an RN 0.88 app: npm install <this repo>, cd ios && npx react-native spm, build in Xcode; initialize + showForm work.
  3. cd example/ios && pod install still succeeds (CocoaPods path unchanged).

Acceptance criteria

  • Package.swift resolves under RN's SwiftPM autolinking; CocoaPods integration unchanged.
  • README documents both paths and the CocoaPods :git source.

Link to ticket

https://trello.com/c/ywKiYIhs

tekinalper and others added 3 commits October 26, 2026 19:19
- Package.swift (RN 0.88+ SwiftPM integration): two targets because SwiftPM
  cannot mix Swift and Objective-C — RNRefinerObjC (RCT_EXTERN_MODULE bridge)
  and RNRefiner (Swift implementation + RefinerSDK dependency) — exposed as one
  RNRefiner product. swiftpmConfig.name = "RNRefiner" in package.json; manifest
  shipped in the npm package.
- update-native-sdk.yml also bumps the RefinerSDK range in Package.swift.
- README: SwiftPM section (experimental) and the CocoaPods :git source for
  RefinerSDK, which is no longer pushed to the CocoaPods trunk.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
….lock

The lock pinned RefinerSDK 1.7.1 and no longer resolves against the ~> 2.0.0 podspec.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@tekinalper
tekinalper marked this pull request as ready for review November 2, 2026 15:02
@tekinalper
tekinalper merged commit 3c0858b into develop Nov 2, 2026
2 checks passed
@tekinalper
tekinalper deleted the feature/spm-support branch November 2, 2026 15:03
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.

1 participant