Migrate from 6.x to 7.x
Learn about migrating from Sentry Cocoa SDK 6.x to 7.x.
Important
We recommend updating to at least 7.5.3, because the HTTP instrumentation can lead to crashes. Alternatively, you can also disable the feature.
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.sampleRatethat 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.currentHubandSentrySDK.setCurrentHub. - Remove
SentryClient.storeEnvelope, which is reserved for Hybrid SDKs. - Make
closeCachedSessionWithTimestampprivate, which is reserved for internal use. - Remove deprecated
SentryHub.getScope. UseSentryHub.scopeinstead. - Replace
SentryException.threadwithSentryException.threadIdandSentryException.stacktraceto align with the unified API. - Replace dict
SentryMechanism.metawith new classSentryMechanismMetaand moveSenryNSErrortoSentryMechanismMetato align with the unified API. - Change
SentryEvent.timestamptonullable.
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
SentrySDK.start { options in
options.logLevel = SentryLogLevel.verbose
}
// Or
SentrySDK.logLevel = SentryLogLevel.verbose
7.x
SentrySDK.start { options in
options.diagnosticLevel = SentryLevel.debug
}
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").