diff --git a/CHANGELOG.md b/CHANGELOG.md index 47db1c614c..84a8c470d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Fixes +- Reporting crashes when restarting the SDK (#2440) - Core data span status with error (#2439) ## 7.31.2 diff --git a/Samples/iOS-Swift/iOS-Swift/AppDelegate.swift b/Samples/iOS-Swift/iOS-Swift/AppDelegate.swift index 69290edc2b..203c22620c 100644 --- a/Samples/iOS-Swift/iOS-Swift/AppDelegate.swift +++ b/Samples/iOS-Swift/iOS-Swift/AppDelegate.swift @@ -7,9 +7,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? static let defaultDSN = "https://6cc9bae94def43cab8444a99e0031c28@o447951.ingest.sentry.io/5428557" - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - + + static 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 = DSNStorage.shared.getDSN() ?? AppDelegate.defaultDSN DSNStorage.shared.saveDSN(dsn: dsn) @@ -45,6 +44,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate { let httpStatusCodeRange = HttpStatusCodeRange(min: 400, max: 599) options.failedRequestStatusCodes = [ httpStatusCodeRange ] } + } + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + + AppDelegate.startSentry() if #available(iOS 14.0, *) { metricKit.receiveReports() diff --git a/Samples/iOS-Swift/iOS-Swift/Base.lproj/Main.storyboard b/Samples/iOS-Swift/iOS-Swift/Base.lproj/Main.storyboard index 0ed14a09ab..029585c65a 100644 --- a/Samples/iOS-Swift/iOS-Swift/Base.lproj/Main.storyboard +++ b/Samples/iOS-Swift/iOS-Swift/Base.lproj/Main.storyboard @@ -1,9 +1,9 @@ - + - + @@ -18,13 +18,13 @@ - + - + - + + + - +