Repository navigation
Migrate from PrivateSentrySDKOnly to [SentryObjCSDK internal] #6370
Copy link
Copy link
Closed
Labels
Description
sentry-cocoa 9.19.0 introduces a new structured hybrid SDK API via SentryObjCSDK.internal (ObjC). The old PrivateSentrySDKOnly class is deprecated and will be removed in the next major version.
Implementation PR: getsentry/sentry-cocoa#8097
Design doc: SENTRY-INTERNAL-API.md
Benefits
- No more internal header imports. Drop
PrivateSentrySDKOnly.h,SentrySwizzle.h, and any private header search path. The new API is fully public. - Structured, discoverable API. Methods are grouped by feature area (
.replay,.profiling,.performance, etc.). - SPM / xcframework compatible. Works with binary distribution — no exposed private headers.
capturereturnsBOOL. No moreperformSelector:workaround ongetReplayIntegration.
Import Change
Since React Native's iOS code is Objective-C (.m / .mm), migrate to the SentryObjC target:
// Before
#import <Sentry/PrivateSentrySDKOnly.h>
#import <Sentry/SentrySwizzle.h>
// After — single import, no private headers
#import <SentryObjC/SentryObjC.h>
// Access via [SentryObjCSDK internal].*Affected Files (as of latest main)
packages/core/ios/RNSentry.mm— largest call site (~30 usages)packages/core/ios/RNSentryStart.m— SDK init, name/version/package setuppackages/core/ios/RNSentryReplay.mm— replay container classespackages/core/ios/RNSentryReplayBreadcrumbConverterHelper.m— replay breadcrumb configpackages/core/ios/RNSentryRNSScreen.m—SentrySwizzle.hmacro usagepackages/core/ios/SentrySDKWrapper.m—options.debug,options.releaseNamepackages/core/ios/SentryScreenFramesWrapper.m—currentScreenFramespackages/core/ios/RNSentrySDK.m—optionsWithDictionary:didFailWithError:
Full migration table
See the detailed migration guide for complete before/after for every method.
Key changes:
[PrivateSentrySDKOnly setSdkName:name andVersionString:version]→[[[SentryObjCSDK internal] sdk] setName:name version:version][PrivateSentrySDKOnly captureReplay](void) →[[[SentryObjCSDK internal] replay] capture](returnsBOOL)SentrySwizzleInstanceMethodmacro →[[[SentryObjCSDK internal] swizzle] swizzleInstanceMethod:inClass:newImpFactory:mode:key:][PrivateSentrySDKOnly envelopeWithData:]→[[[SentryObjCSDK internal] envelope] deserializeFrom:][PrivateSentrySDKOnly optionsWithDictionary:didFailWithError:]→[[SentryObjCSDK internal] optionsFromDictionary:error:]
Checklist
- Replace all
PrivateSentrySDKOnlycall sites with[SentryObjCSDK internal].* - Remove
SentrySwizzle.himport and macro usage inRNSentryRNSScreen.m - Change imports from
#import <Sentry/PrivateSentrySDKOnly.h>to#import <SentryObjC/SentryObjC.h> - Remove private header search paths from Podspec / build settings
- Remove
performSelector:workaround for replay capture - Bump minimum
sentry-cocoadependency to9.19.0+ - Run full test suite
Reactions are currently unavailable
Activity
linear-code commentedon Jun 29, 2026
RN-692
refactor(ios): Migrate from PrivateSentrySDKOnly to SentrySDK.internal
refactor(ios): Migrate from PrivateSentrySDKOnly to SentrySDK.internal
refactor(ios): Migrate from PrivateSentrySDKOnly to SentrySDK.internal
fix(ios): Drop macOS SentryScreenFrames stub + link PR in CHANGELOG
refactor(ios): Migrate from PrivateSentrySDKOnly to SentrySDK.internal
fix(ios): Drop macOS SentryScreenFrames stub + link PR in CHANGELOG
refactor(ios): Migrate from PrivateSentrySDKOnly to SentrySDK.internal (
github-actions commentedon Jul 16, 2026
A PR closing this issue has just been released 🚀
This issue was referenced by PR #6380, which was included in the 8.19.0 release.