From 77c5cf65223ebe09a88ba9f0212bdbbae3c7a798 Mon Sep 17 00:00:00 2001 From: Andrey Kornich Date: Tue, 23 Feb 2021 17:10:22 -0800 Subject: [PATCH] upgraded a demo app with usage of a crash reporter --- .../xcshareddata/swiftpm/Package.resolved | 4 ++-- Demos/macosAppSwiftSPM/macosAppSwiftSPM/AppDelegate.swift | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Demos/macosAppSwiftSPM/macosAppSwiftSPM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Demos/macosAppSwiftSPM/macosAppSwiftSPM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index e2662128..9b8e61b4 100644 --- a/Demos/macosAppSwiftSPM/macosAppSwiftSPM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Demos/macosAppSwiftSPM/macosAppSwiftSPM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -15,7 +15,7 @@ "repositoryURL": "https://github.com/microsoft/plcrashreporter.git", "state": { "branch": "master", - "revision": "280cf16a19d85b707b6cc9fc235dde7457f6f7cc", + "revision": "2afa27e23452171b971f67730821b7befa96842b", "version": null } }, @@ -24,7 +24,7 @@ "repositoryURL": "https://github.com/rollbar/rollbar-apple", "state": { "branch": "master", - "revision": "400af0840dcbd69454c3275e710445c5874084b5", + "revision": "f32c08cf61692a2fbe7de5e0aedf49a1d1534683", "version": null } } diff --git a/Demos/macosAppSwiftSPM/macosAppSwiftSPM/AppDelegate.swift b/Demos/macosAppSwiftSPM/macosAppSwiftSPM/AppDelegate.swift index 2292d42b..e907a8ba 100644 --- a/Demos/macosAppSwiftSPM/macosAppSwiftSPM/AppDelegate.swift +++ b/Demos/macosAppSwiftSPM/macosAppSwiftSPM/AppDelegate.swift @@ -8,6 +8,7 @@ import Cocoa import RollbarNotifier +import RollbarPLCrashReporter //import SwiftTryCatch2 @NSApplicationMain @@ -41,12 +42,16 @@ class AppDelegate: NSObject, NSApplicationDelegate { // configure Rollbar: let config = RollbarConfig.init(); + // define optional crash report collector: + let crashCollector = RollbarPLCrashCollector(); + //config.crashLevel = @"critical"; config.destination.accessToken = "2ffc7997ed864dda94f63e7b7daae0f3"; config.destination.environment = "samples"; config.customData = [ "someKey": "someValue", ]; // init Rollbar shared instance: - Rollbar.initWithConfiguration(config); + Rollbar.initWithConfiguration(config, crashCollector: crashCollector); + //Rollbar.initWithConfiguration(config); Rollbar.infoMessage("Rollbar is up and running! Enjoy your remote error and log monitoring..."); }