sentry-cocoa 9.19.0 introduces a new structured hybrid SDK API via SentrySDK.internal (Swift) and 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
- Eliminates internal header imports. Drop
PrivateSentrySDKOnly.h and Sentry-Swift.h. The new API is fully public via <SentryObjC/SentryObjC.h>.
- Proper debug image lookup API.
SentryBinaryImageCache (internal class accessed directly) is replaced by [[SentryObjCSDK internal] debug] which accepts NSArray<NSNumber *> addresses directly — no string conversion needed.
- SPM / xcframework compatible. Works with binary distribution — no exposed private headers.
Import Change
Godot's iOS code is Objective-C++ (.mm) — migrate to the SentryObjC target:
// Before
#import <Sentry/PrivateSentrySDKOnly.h>
#import <Sentry/Sentry-Swift.h> // in cocoa_includes.h
// After — single import, no internal headers
#import <SentryObjC/SentryObjC.h>
Key Changes
SDK Name
| Before |
After |
[PrivateSentrySDKOnly setSdkName:@"sentry.cocoa.godot"] |
[SentryObjCSDK internal].sdk.name = @"sentry.cocoa.godot" |
Tracing
| Before |
After |
[PrivateSentrySDKOnly setTrace:trace_id spanId:span_id] |
[[SentryObjCSDK internal] setTrace:trace_id spanId:span_id] |
Note: If trace_id and span_id are currently SentryId / SentrySpanId (Swift types from Sentry-Swift.h), replace with SentryObjCId / SentryObjCSpanId:
SentryObjCId *traceId = [[SentryObjCId alloc] initWithUUIDString:traceString];
SentryObjCSpanId *spanId = [[SentryObjCSpanId alloc] initWithValue:spanString];
[[SentryObjCSDK internal] setTrace:traceId spanId:spanId];
Debug Images (.debug)
| Before |
After |
SentryBinaryImageCache + [cache imageByAddress:] |
[[[SentryObjCSDK internal] debug] imagesForAddresses:@[@(address)]] |
The new API accepts NSArray<NSNumber *> of UInt64 addresses directly and returns NSArray<SentryObjCDebugMeta *>, eliminating the need to import internal SentryBinaryImageCache and SentryDependencies.
Affected Files (as of latest main)
src/sentry/cocoa/cocoa_sdk.mm — setSdkName:, setTrace:spanId:
src/sentry/cocoa/cocoa_includes.h — Sentry-Swift.h import
src/sentry/cocoa/cocoa_debug_images.mm — SentryBinaryImageCache direct access
Checklist
sentry-cocoa9.19.0 introduces a new structured hybrid SDK API viaSentrySDK.internal(Swift) andSentryObjCSDK.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.handSentry-Swift.h. The new API is fully public via<SentryObjC/SentryObjC.h>.SentryBinaryImageCache(internal class accessed directly) is replaced by[[SentryObjCSDK internal] debug]which acceptsNSArray<NSNumber *>addresses directly — no string conversion needed.Import Change
Godot's iOS code is Objective-C++ (
.mm) — migrate to theSentryObjCtarget:Key Changes
SDK Name
[PrivateSentrySDKOnly setSdkName:@"sentry.cocoa.godot"][SentryObjCSDK internal].sdk.name = @"sentry.cocoa.godot"Tracing
[PrivateSentrySDKOnly setTrace:trace_id spanId:span_id][[SentryObjCSDK internal] setTrace:trace_id spanId:span_id]Note: If
trace_idandspan_idare currentlySentryId/SentrySpanId(Swift types fromSentry-Swift.h), replace withSentryObjCId/SentryObjCSpanId:Debug Images (
.debug)SentryBinaryImageCache+[cache imageByAddress:][[[SentryObjCSDK internal] debug] imagesForAddresses:@[@(address)]]The new API accepts
NSArray<NSNumber *>ofUInt64addresses directly and returnsNSArray<SentryObjCDebugMeta *>, eliminating the need to import internalSentryBinaryImageCacheandSentryDependencies.Affected Files (as of latest
main)src/sentry/cocoa/cocoa_sdk.mm—setSdkName:,setTrace:spanId:src/sentry/cocoa/cocoa_includes.h—Sentry-Swift.himportsrc/sentry/cocoa/cocoa_debug_images.mm—SentryBinaryImageCachedirect accessChecklist
PrivateSentrySDKOnlycall sites with[SentryObjCSDK internal].*SentryBinaryImageCachedirect access with[[SentryObjCSDK internal] debug]Sentry-Swift.himport fromcocoa_includes.h#import <SentryObjC/SentryObjC.h>SentryId/SentrySpanIdwithSentryObjCId/SentryObjCSpanIdsentry-cocoadependency to9.19.0+