Commit 404d962
committed
feat(ios): opt-in consumption of sentry-cocoa via Swift Package Manager
Adds a new opt-in path in RNSentry.podspec: when `SENTRY_USE_SPM=1` is set
in the environment before `pod install`, RNSentry pulls `Sentry` from the
sentry-cocoa SPM package (as a binary xcframework) instead of from the
Sentry CocoaPods source build.
Default behavior is unchanged. Existing users on any React Native version
keep their current CocoaPods-based consumption with no action required.
The opt-in path requires React Native >= 0.75 because it uses the
`SPMManager` singleton defined in `react-native/scripts/cocoapods/spm.rb`,
which is loaded transitively from the Podfile via `react_native_pods.rb`.
This is the first step of the broader SPM migration tracked at #5780. It
unblocks experimentation with binary-framework consumption of sentry-cocoa
while keeping CocoaPods as the production default.
Two known caveats for users opting in today:
1. The Sentry xcframework in sentry-cocoa 9.13.0 and earlier is missing the
`SentrySessionReplayHybridSDK` symbol due to a packaging bug
(getsentry/sentry-cocoa#7911). Apps that use Session Replay will fail to
link until that fix ships in a sentry-cocoa release. Apps not using
Session Replay are unaffected.
2. `SentrySwizzle.h` must be imported via framework-style (`<Sentry/...>`)
rather than quote-style when the xcframework is the consumption path —
already handled by #6175 (in this same release).
Verified locally:
- Default `pod install` (no env var) — `** BUILD SUCCEEDED **` on the
RN sample, identical to the pre-change state.
- `SENTRY_USE_SPM=1 pod install` — Sentry no longer in Podfile.lock,
`XCRemoteSwiftPackageReference "sentry-cocoa"` injected into the Xcode
project, [SPM] log lines confirm the helper ran correctly.
Refs: #5780, #61701 parent a5d243c commit 404d962
2 files changed
Lines changed: 24 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
54 | 76 | | |
55 | 77 | | |
56 | 78 | | |
| |||
0 commit comments