Migrate from 6.x to 7.x

Learn about migrating from Sentry Cocoa SDK 6.x to 7.x.

Migrating to 7.x from 6.x includes a few breaking changes. We provide this guide to help you to update your SDK.

This version includes the following configuration changes:

  • Change the default maximum number of cached envelopes from 100 to 30. You can now configure this number with SentryOptions.maxCacheItems.
  • When setting a value SentryOptions.sampleRate that is not >= 0.0 and <= 1.0 the SDK sets it to the default of 1.0 instead of keeping the set value.

This version introduces a change to the grouping of issues. The SDK now sets the inApp flag for frames originating from only the main executable using CFBundleExecutable. In previous versions, all frames originating from the application bundle were marked as inApp. This had the downside of marking frames of private frameworks inside the bundle as inApp. This problem is fixed now. Applications using static frameworks shouldn't be affected by this change. For more information read mark in-app frames.

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.

  • Remove SentrySDK.currentHub and SentrySDK.setCurrentHub.
  • Remove SentryClient.storeEnvelope, which is reserved for Hybrid SDKs.
  • Make closeCachedSessionWithTimestamp private, which is reserved for internal use.
  • Remove deprecated SentryHub.getScope. Use SentryHub.scope instead.
  • Replace SentryException.thread with SentryException.threadId and SentryException.stacktrace to align with the unified API.
  • Replace dict SentryMechanism.meta with new class SentryMechanismMeta and move SenryNSError to SentryMechanismMeta to align with the unified API.
  • Change SentryEvent.timestamp to nullable.

We replaced the SentryLogLevel with SentryLevel, renamed logLevel to diagnosticLevel on SentryOptions to align with other Sentry SDKs, and set the default diagnosticLevel to SentryLevel.debug. Furthermore, we removed setting the logLevel statically on the SentrySDK. Please use the SentryOptions to set the diagnosticLevel instead.

6.x

Copied
SentrySDK.start { options in
  options.logLevel = SentryLogLevel.verbose
}

// Or

SentrySDK.logLevel = SentryLogLevel.verbose

7.x

Copied
SentrySDK.start { options in
  options.diagnosticLevel = SentryLevel.debug
}
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").