recordBreadcrumb

recordBreadcrumb:(NSString* __nonnull)name attributes:(NSDictionary* __nullable)attributes; NewRelic.recordBreadcrumb(string $Name, map $eventAttributes)
Records a MobileBreadcrumb event, useful for crash analysis.

Requirements

Description

This call creates and records a MobileBreadcrumb event, which can be found in Insights and in the crash event trail. Mobile breadcrumbs are useful for crash analysis; they should be created for app activity that you think will help you troubleshoot crashes.

In addition to whatever custom attributes you choose, the event will also have associated session attributes. Unlike using setAttribute, adding attributes to a breadcrumb event adds them only to that event; they are not session attributes.

Using this call has the same result as using the recordCustomEvent call with MobileBreadcrumb as the event type. For context on how to use this API, see the documentation about sending custom attributes and events to Insights for:

Parameters

Parameter Description

$Name

string

Required. The name you want to give to the breadcrumb event.

$eventAttributes

map<string, object>

Optional. A map that includes a list of attributes of the breadcrumb event. Create attributes for any event descriptors you think will be useful.

Return value(s)

Returns true if the event is recorded successfully, or false if not.

Example(s)

Objective-C

Method:

+ (BOOL) recordBreadcrumb:(NSString* __nonnull)name attributes:(NSDictionary* __nullable)attributes;

Example:

[NewRelic recordBreadcrumb:@"user 11-3435 tapped sign-in button on LaunchViewController" 
	attributes:@{ @"button" : @"sign-in", @"action" : @"tapped", @"userId" : @"11-3435", @"location" : @"LaunchViewController"}];

Swift

Method:

NewRelic.recordBreadcrumb(Name: String!, attributes:[NSObject : AnyObject]!) -> Bool

Examples:

let eventRecorded = NewRelic.recordBreadcrumb("Name",
attributes: ["attributeName1" : "value1", "attributeName2": 2])
let eventRecorded = NewRelic.recordBreadcrumb("user 11-3435 tapped sign-in from LaunchViewController" 
	attributes:["button" : "sign-in", "userId" : "11-3435", "action" : "tapped", "location" : "LaunchViewController"])

For more help

Recommendations for learning more: