Splunk MINT SDK for iOS (Legacy)

Splunk MINT SDK for iOS Developer Guide

Splunk MINT is no longer available for purchase as of January 29, 2021. Customers who have already been paying to ingest and process MINT data in Splunk Enterprise will continue to receive support until December 31, 2021, which is End of Life for all MINT products: App, Web Service (Management Console), SDK and Add-On.
This documentation does not apply to the most recent version of Splunk MINT SDK for iOS (Legacy). For documentation on the most recent version, go to the latest release.

Add custom data to crash reports

Although Splunk MINT collects plenty of data associated with each crash of your app, you can collect additional custom crash data. To add custom data to your crash reports, use the extra data map. The data values have a length limit of 128 characters.

  • To add custom data as a key-value pair, use the addExtraData: selector as follows:
  • // Objective-C
    [[Mint sharedInstance] addExtraData:[[ExtraData alloc] initWithKey:@"Global Extra Key1" andValue:@"Global Extra Value1"]];
    
    // Swift
    Mint.sharedInstance().addExtraData(ExtraData(key: "Global Extra Key1", andValue: "Global Extra Value1"))
    

    The addExtraData selector accepts an ExtraData class instance, which you can initialize using the custom initializer initWithKey:andValue: to pass custom values.

    This method adds an instance to the global LimitedExtraDataList global singleton instance object and sends appropriate values to the Splunk MINT server as key-value pairs, which you can then examine your request.

  • To access the global LimitedExtraDataList with the [Mint sharedInstance].extraDataList property:
  • // Objective-C
    [[Mint sharedInstance].extraDataList addWithKey:@"test1" andValue:@"testValue1"];
    
    // Swift
    Mint.sharedInstance().extraDataList.addWithKey("Test1", andValue: "TestValue")
    

    This usage gives the same result as the addExtraData: method of the Mint instance because both methods access the same global LimitedExtraDataList singleton instance. The LimitedExtraDataList is an object that is limited to a maximum count of 32 objects. If you try to add an object that exceeds this count, the first object in the list is removed, FIFO. You can't add multiple values with the same key. If you try, you will not get an error but the value of an existing key will change.

  • To remove a specific value from the extra data, use the removeExtraDataWithKey: method.
  • To clear the extra data completely, use the clearExtraData: method.

To view the custom crash data in Splunk MINT Management Console:

  1. Go to the Errors dashboard and select an error.
  2. In the error details section, click the Error Instances tab.
  3. In the Show All column, click the arrow.
Last modified on 10 March, 2015
Report handled exceptions   Add breadcrumbs to crash reports

This documentation applies to the following versions of Splunk MINT SDK for iOS (Legacy): 4.0.x


Was this topic useful?







You must be logged into splunk.com in order to post comments. Log in now.

Please try to keep this discussion focused on the content covered in this documentation topic. If you have a more general question about Splunk functionality or are experiencing a difficulty with Splunk, consider posting a question to Splunkbase Answers.

0 out of 1000 Characters