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.
capture returns BOOL. No more performSelector: workaround on getReplayIntegration.
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 setup
packages/core/ios/RNSentryReplay.mm — replay container classes
packages/core/ios/RNSentryReplayBreadcrumbConverterHelper.m — replay breadcrumb config
packages/core/ios/RNSentryRNSScreen.m — SentrySwizzle.h macro usage
packages/core/ios/SentrySDKWrapper.m — options.debug, options.releaseName
packages/core/ios/SentryScreenFramesWrapper.m — currentScreenFrames
packages/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] (returns BOOL)
SentrySwizzleInstanceMethod macro → [[[SentryObjCSDK internal] swizzle] swizzleInstanceMethod:inClass:newImpFactory:mode:key:]
[PrivateSentrySDKOnly envelopeWithData:] → [[[SentryObjCSDK internal] envelope] deserializeFrom:]
[PrivateSentrySDKOnly optionsWithDictionary:didFailWithError:] → [[SentryObjCSDK internal] optionsFromDictionary:error:]
Checklist
sentry-cocoa9.19.0 introduces a new structured hybrid SDK API viaSentryObjCSDK.internal(ObjC). The oldPrivateSentrySDKOnlyclass is deprecated and will be removed in the next major version.Implementation PR: getsentry/sentry-cocoa#8097
Design doc: SENTRY-INTERNAL-API.md
Benefits
PrivateSentrySDKOnly.h,SentrySwizzle.h, and any private header search path. The new API is fully public..replay,.profiling,.performance, etc.).capturereturnsBOOL. No moreperformSelector:workaround ongetReplayIntegration.Import Change
Since React Native's iOS code is Objective-C (
.m/.mm), migrate to theSentryObjCtarget: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
PrivateSentrySDKOnlycall sites with[SentryObjCSDK internal].*SentrySwizzle.himport and macro usage inRNSentryRNSScreen.m#import <Sentry/PrivateSentrySDKOnly.h>to#import <SentryObjC/SentryObjC.h>performSelector:workaround for replay capturesentry-cocoadependency to9.19.0+