stopCurrentInteraction (iOS SDK API)

Syntax

+ (void) stopCurrentInteraction:(NSString*)interactionIdentifier;

Stop interaction trace associated with the provided interactionIdentifier.

Requirements

Compatible with all agent versions.

Description

This method will stop the interaction trace associated with the interactionIdentifier (which is returned by the startInteractionWithName: method). It's not necessary to call this method to complete an interaction trace (an interaction trace will intelligently complete on its own). However, use this method if you want a more discrete interaction period. For context on how to use this API, see the documentation about interaction traces:

Parameters

Parameter

Description

$interactionIdentifier

string

Required. The value returned by startInteractionWithName: . It is required to pass this string to manually complete the interaction trace.

Examples

Objective-C

Example:

NSString *identifier = [NewRelic startInteractionWithName: @"myInteractionName"];
[NewRelic stopCurrentInteraction: identifier];

Swift

Example:

let identifier = NewRelic.startInteraction(withName: "myInteractionName")
NewRelic.stopCurrentInteraction(identifier)