Adds a "Send anonymous telemetry" toggle in Settings that lets users disable Sentry crash reporting and PostHog analytics. The setting is frozen at launch so toggling mid-session shows a restart hint. The hint correctly clears if the user toggles back to the launch-time value.
10 lines
402 B
Swift
10 lines
402 B
Swift
import Sentry
|
|
|
|
/// Add a Sentry breadcrumb for user-action context in hang/crash reports.
|
|
func sentryBreadcrumb(_ message: String, category: String = "ui", data: [String: Any]? = nil) {
|
|
guard TelemetrySettings.enabledForCurrentLaunch else { return }
|
|
let crumb = Breadcrumb(level: .info, category: category)
|
|
crumb.message = message
|
|
crumb.data = data
|
|
SentrySDK.addBreadcrumb(crumb)
|
|
}
|