Migrate from 8.x to 9.x
Learn about migrating from Sentry Cocoa SDK 8.x to 9.x.
Migrating to 9.x from 8.x includes several breaking changes. We provide this guide to help you update your SDK.
We bumped the minimum supported OS versions to:
- iOS: 15.0 (previously 11.0)
- macOS: 10.14 (previously 10.13)
- tvOS: 15.0 (previously 11.0)
- visionOS: 1.0 (unchanged)
- watchOS: 8.0 (previously 4.0)
We now build the precompiled XCFramework with Xcode 16. To submit to the App Store, Apple now requires Xcode 16. If you need a precompiled XCFramework built with Xcode 15, continue using Sentry SDK 8.x.x.
Additionally, the Package.swift sets swift-tools-version to 6.0.
We dropped official support for Carthage in v9. If you're using Carthage, please migrate to Swift Package Manager (SPM) or manually install the pre-built XCFramework from GitHub releases.
We now enabled the following features by default:
- Performance V2 is enabled by default: The app start duration now finishes when the first frame is drawn instead of when the OS posts the
UIWindowDidBecomeVisibleNotification. We removed theenablePerformanceV2option. - Pre-warmed app start tracking: The SDK now collects pre-warmed app starts by default via
enablePreWarmedAppStartTracing. - App hang tracking V2: This is now the default only on **iOS and tvOS and we removed the option to enable/disable it. macOS still uses V1.
We now automatically disable app hang tracking for: Widgets, Live Activities, Action Extensions, (Siri) Intent Extensions, Share Extensions. These components run in separate processes or sandboxes with different execution characteristics, which can cause false positive app hang reports.
We moved structured logging out of experimental and made it part of the stable API. The enableLogs option moved from options.experimental.enableLogs to options.enableLogs. We added log APIs to Hub and Client, and logs now include a sentry.replay_id attribute.
Migration required: Update your code from options.experimental.enableLogs = true to options.enableLogs = true. Logging is not enabled by default; you must explicitly set this option.
HTTP client errors now mark sessions as errored. This provides better visibility into failed network requests in your release health data.
We removed all deprecated profiling APIs in version 9.0.0.
enableFileManagerSwizzlingis now a top-level non-experimental option and remains disabled by default.enableDataSwizzlingis now a top-level option and is enabled by default.enableLogsis now a top-level non-experimental option and remains disabled by default (you must set it totrueto enable logging).- We increased the maximum attachment size to 200MB (previously 20MB)
- We removed the following methods and properties:
inAppExclude(it had no effect)integrationsdefaultIntegrations()enableTracing(usetracesSampleRateortracesSamplerinstead)getStoreEndpoint()enablePerformanceV2the behavior of this option is now enabled by default.
- The default trace context status is now
okinstead ofundefined. - The
functionproperty onSentryFramenow defaults tonilinstead of"<redacted>" - The
valueandtypeproperties onSentryExceptionare now nullable; whenNSExceptionhas no reason,typeis set tonil - We changed the type of the
http.response.status_codeattribute for spans to int - We converted
SentryDsnto Swift and removed the public header fileSentryDsn.h
- We renamed
SentryStructuredLogLeveltoSentryLogLevel - We renamed
SentryStructuredLogAttributetoSentryLogAttribute
- We removed the
segmentproperty fromSentryTraceContext,SentryUser, andSentryBaggage - We removed the initializers from
SentryTraceContext - We removed
SentryDsn.getHash() - We removed
SentryFrame.instruction
We removed the following deprecated APIs:
SentrySpan.setExtraValue(_:forKey:)- User feedback API (use the new feedback API instead)
Scope.useSpan()(useScope.spaninstead)SentryDebugMeta.uuid(usedebugIDinstead)SentryDebugMeta.name(usecodeFileinstead)
We made the following classes and APIs private:
SentryEventDecoderandSentryEventDecodableSentryEnvelopeItemHeaderSentryIntegrationProtocolSentrySessionSentrySDKInfoSentryDebugImageProvider
- We made the following classes
final:PreviewRedactOptions,SentryProfileOptions,SentryRedactViewHelper,SentryViewScreenshotOptions,SentryReplayOptions,SentryUserFeedbackConfiguration,SentryUserFeedbackFormConfiguration,SentryUserFeedbackThemeConfiguration,SentryUserFeedbackWidgetConfiguration,SentryFeedback, andSentryExperimentalOptions
For a complete list of changes, see the Changelog of version 9.0.0
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").