CrittercismDidCrashOnLastLoadNotification
Listen to this notification to get crash data from the previous session. The notification userInfo contains some useful information related to the crash.
The following example shows how you can register to receive crash notifications.
Objective-C
NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
NSOperationQueue *mainQueue = [NSOperationQueue mainQueue];
self.observer = [center addObserverForName:CrittercismDidCrashOnLastLoadNotification
object:nil
queue:mainQueue
usingBlock:^(NSNotification *notification) {
NSString *crashName = notification.userInfo[CrittercismCrashName];
NSString *crashReason = notification.userInfo[CrittercismCrashReason];
NSDate *crashDate = notification.userInfo[CrittercismCrashDate];
NSArray *crashViews = notification.userInfo[CrittercismCrashView];
// ...
}];
Swift
let center = NotificationCenter.default
let mainQueue = OperationQueue.main
let localChangeObserver = center.addObserver(forName: NSLocale.currentLocaleDidChangeNotification,
object: nil,
queue: mainQueue) { (notification) in
let crashName = notification.userInfo?[CrittercismCrashName];
let crashReason = notification.userInfo?[CrittercismCrashReason];
let crashDate = notification.userInfo?[CrittercismCrashDate];
let crashViews = notification.userInfo?[CrittercismCrashView];
// ...
}
Objective-C
NSString * const CrittercismDidCrashOnLastLoadNotification
Swift
let CrittercismDidCrashOnLastLoadNotification: String
Last Crash UserInfo Keys
The CrittercismDidCrashOnLastLoadNotification userInfo contains the crash name, reason, date, and an array of crashed view controller names.
|
Returns an |
|
Returns an |
|
Returns an |
|
Returns an |
By default, Workspace ONE Intelligence SDK prints a few messages (via NSLog) to the device log that may be useful to verify that Workspace ONE Intelligence SDK is initialized and properly working. If you don’t want to see Workspace ONE Intelligence log messages, you can tune the amount of logging that is displayed.
See Setting Log Verbosity Of Workspace ONE Intelligence SDK of how to tweak the logging level
CRLoggingLevel
Objective-C
typedef enum : NSInteger {
CRLoggingLevelSilent,
CRLoggingLevelError,
CRLoggingLevelWarning,
CRLoggingLevelInfo,
CRLoggingLevelDebug
} CRLoggingLevel;
Swift
enum CRLoggingLevel : Int {
case Silent
case Error
case Warning
case Info
case Debug
}
|
Turns off all Workspace ONE Intelligence SDK log messages |
|
Only print errors. An error is an unexpected event that will result not capturing important data |
|
(Default) Only print warnings. Currently warning messages are printed when calling Workspace ONE Intelligence SDK methods before initializing Workspace ONE Intelligence |
|
The most verbose level of logging |
|
Print internal logging in Workspace ONE Intelligence SDK. Please use this logging level and attach your log in your email to our support |