Migrate from 7.x to 8.x
Learn about migrating from Sentry Cocoa SDK 7.x to 8.x.
Migrating to 8.x from 7.x includes a few breaking changes. We provide this guide to help you update your SDK. It's important to note that this version adds a dependency to Swift, and that we renamed the default branch on the sentry-cocoa repository from master to main.
The minimum supported OS versions have been bumped to macOS 10.13, iOS 11, tvOS 11, and watchOS 4. We bumped the minimum Xcode version to 13.
The following features are now enabled by default:
- The user interaction tracing integration
- The File I/O tracing integration
- Core Data tracing integration
- Capture failed requests
- App Hangs (not available for watchOS)
App Hang events might group differently as we now set the event stack trace snapshot property to true.
The OOM (out of memory integration) actually tracks watchdog terminations based on heuristics. We renamed the integration to better reflect what it does.
This version includes the following configuration changes:
- Rename
SentryOptions.enableAutoPerformanceTrackingtoSentryOptions.enableAutoPerformanceTracing - Rename
SentryOptions.enableUIViewControllerTrackingtoSentryOptions.enableUIViewControllerTracing - Rename
SentryOptions.enablePreWarmedAppStartTrackingtoSentryOptions.enablePreWarmedAppStartTracing - Rename
SentryOptions.enableFileIOTrackingtoSentryOptions.enableFileIOTracing - Rename
SentryOptions.enableCoreDataTrackingtoSentryOptions.enableCoreDataTracing - Rename
SentryOptions.enableOutOfMemoryTrackingtoSentryOptions.enableWatchdogTerminationTracking
We made some changes to make the API more ergonomic in Swift:
- Rename
SentrySDK.addBreadcrumb(crumb:)toSentrySDK.addBreadcrumb(_ crumb:) - Rename
SentryScope.add(_ crumb:)toSentryScope.addBreadcrumb(_ crumb:) - Rename
SentryScope.add(_ attachment:)toSentryScope.addAttachment(_ attachment:) - Rename
ClienttoSentryClient
We cleaned up our public classes by removing a few functions and properties, that shouldn't be public, to make the API cleaner. In case we removed something you need, please open an issue on GitHub.
- Make
SpanProtocol.datanon nullable - Mark
[SpanProtocol setExtraValue:forKey:]as deprecated - Make
SpanContextimmutable- Remove tags from
SpanContext - Remove context property from
SentrySpan
- Remove tags from
- Remove
SentryScope.apply(to:) - Remove
SentryScope.apply(to:maxBreadcrumb:) - Remove
[SentryOptions initWithDict:didFailWithError:] - Remove
[SentryOptions sdkInfo] - Make
SentrySessionandSentrySDKInfointernal - Remove default attachment content type
- Remove
captureEnvelopefromSentryHubandSentryClient - Remove confusing transaction tag
We removed the version of SentrySDK.startWithOptions that took a dictionary, and renamed SentrySDK.startWithOptionsObject to SentrySDK.startWithOptions. The recommended way to initialize Sentry has not changed:
import Sentry
SentrySDK.start { options in
options.dsn = "___PUBLIC_DSN___"
// ...
}
SentrySDK.close now calls flush, which is a blocking call.
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").