Skip to content

Commit

Permalink
Merge branch 'main' into antonis-add-breadrumb-origin
Browse files Browse the repository at this point in the history
  • Loading branch information
antonis committed Sep 24, 2024
2 parents 77cc812 + 2233968 commit ca96963
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Samples/iOS-Swift/iOS13-Swift/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

func startSentry() {
// For testing purposes, we want to be able to change the DSN and store it to disk. In a real app, you shouldn't need this behavior.
let dsn: String? = nil
var storedDsn: String?
do {
let dsn = try DSNStorage.shared.getDSN() ?? AppDelegate.defaultDSN
try DSNStorage.shared.saveDSN(dsn: dsn)
storedDsn = try DSNStorage.shared.getDSN()
try DSNStorage.shared.saveDSN(dsn: storedDsn ?? Self.defaultDSN)
} catch {
print("[iOS-Swift] Failed to read/write DSN: \(error)")
}

let dsn = storedDsn ?? Self.defaultDSN

SentrySDK.start { options in
options.dsn = dsn
options.debug = true
Expand Down

0 comments on commit ca96963

Please sign in to comment.