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:

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.enableAutoPerformanceTracking to SentryOptions.enableAutoPerformanceTracing
  • Rename SentryOptions.enableUIViewControllerTracking to SentryOptions.enableUIViewControllerTracing
  • Rename SentryOptions.enablePreWarmedAppStartTracking to SentryOptions.enablePreWarmedAppStartTracing
  • Rename SentryOptions.enableFileIOTracking to SentryOptions.enableFileIOTracing
  • Rename SentryOptions.enableCoreDataTracking to SentryOptions.enableCoreDataTracing
  • Rename SentryOptions.enableOutOfMemoryTracking to SentryOptions.enableWatchdogTerminationTracking

We made some changes to make the API more ergonomic in Swift:

  • Rename SentrySDK.addBreadcrumb(crumb:) to SentrySDK.addBreadcrumb(_ crumb:)
  • Rename SentryScope.add(_ crumb:) to SentryScope.addBreadcrumb(_ crumb:)
  • Rename SentryScope.add(_ attachment:) to SentryScope.addAttachment(_ attachment:)
  • Rename Client to SentryClient

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.data non nullable
  • Mark [SpanProtocol setExtraValue:forKey:] as deprecated
  • Make SpanContext immutable
    • Remove tags from SpanContext
    • Remove context property from SentrySpan
  • Remove SentryScope.apply(to:)
  • Remove SentryScope.apply(to:maxBreadcrumb:)
  • Remove [SentryOptions initWithDict:didFailWithError:]
  • Remove [SentryOptions sdkInfo]
  • Make SentrySession and SentrySDKInfo internal
  • Remove default attachment content type
  • Remove captureEnvelope from SentryHub and SentryClient
  • 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:

Copied
import Sentry

SentrySDK.start { options in
    options.dsn = "___PUBLIC_DSN___"
    // ...
}

SentrySDK.close now calls flush, which is a blocking call.

Was this helpful?
Help improve this content
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").