Crash tracking lets you analyze crashes and exceptions inside your iOS app. When enabled, the SDK automatically attaches crash parameters to event requests. To analyze them in Mapp Intelligence, the corresponding parameters must be configured in your account.
Tracked parameters
The following parameters are sent automatically once crash tracking is enabled. They must be configured as Event Parameters in your Mapp Intelligence account for analysis:
Parameter | Description | Where to analyze |
|---|---|---|
Crash – Type | Type of crash:
| metric |
Crash – Name | Name of the crash, either system-generated or custom (when custom type is used). | Navigation > Event Parameter |
Crash – Message | Message associated with the crash, system or custom. | |
Crash – Cause Message | Parsed string from the crash message. | |
Crash – Stack | Stack where the crash happened. | |
Crash – Cause Stack | Stack that caused the crash. |
Methods
Method | Description | Tracking Options |
|---|---|---|
| Enables crash tracking and selects which exception types are tracked. |
|
| Tracks a caught | — |
| Tracks a custom exception with name and message. | — |
Example
Enable crash tracking in your global configuration:
MappIntelligence.shared()?.initWithConfiguration( [123451234512345], onTrackdomain: "https://your-trackdomain.com" ) MappIntelligence.shared()?.enableCrashTracking(.allExceptionTypes)Track caught and custom exceptions in your view controllers:
// Custom exception with name and message MappIntelligence.shared()?.trackException( withName: "Test Exception", andWithMessage: "Test Exception Message" ) // Caught NSError let userInfo: [String: Any] = [ NSLocalizedDescriptionKey: "Unauthorized", NSLocalizedFailureReasonErrorKey: "Account not activated" ] let error = NSError(domain: "MyAppDomain", code: 401, userInfo: userInfo) MappIntelligence.shared()?.trackException(with: error)
Enable crash tracking in your global configuration:
[[MappIntelligence shared] initWithConfiguration:@[@123451234512345] onTrackdomain:@"https://your-trackdomain.com"]; [[MappIntelligence shared] enableCrashTracking:allExceptionTypes];Track caught and custom exceptions:
// Custom exception with name and message [[MappIntelligence shared] trackExceptionWithName:@"Test Exception" andWithMessage:@"Test Exception Message"]; // Caught NSError NSDictionary *userInfo = @{ NSLocalizedDescriptionKey: @"Unauthorized", NSLocalizedFailureReasonErrorKey: @"Account not activated" }; NSError *error = [[NSError alloc] initWithDomain:@"MyAppDomain" code:401 userInfo:userInfo]; [[MappIntelligence shared] trackExceptionWith:error];
Uncaught exceptions are captured automatically once
enableCrashTrackingis set to a type that includesuncaught. You do not need to wrap your code in additional handlers for this case.
Related pages: Configure Global Tracking.