• /
  • EnglishEspañolFrançais日本語한국어Português
  • Inicia sesiónComenzar ahora

Pause replay

Syntax

Java

NewRelic.pauseReplay()

Kotlin

NewRelic.pauseReplay()

Requirements

  • Android agent v7.7.0 or higher.

    Description

    newrelic.pauseReplay() can be called to manually force a replay to pause recording.

    If a replay is not already in progress, this API method will have no effect.

    If the mobile session is still valid, you can resume a paused replay by calling the newrelic.recordReplay() API method.

    Use Cases

  • You want to manually trigger a replay to stop recording on certain site pages or under certain conditions, such as a healthcare page, credit card info page, etc.

    Example

    Here's an example of forcing a replay to pause recording.

    Java

public class MainActivity extends Activity {
...
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.pause_replay:
NewRelic.pauseReplay();
...
return true;
default:
return super.onOptionsItemSelected(item);
}
}
...
}

Kotlin

class MainActivity : AppCompatActivity() {
...
var client: OkHttpClient = OkHttpClient();
binding.fab.setOnClickListener { view ->
NewRelic.pauseReplay()
}
}
...

Syntax

Objective-c

[NewRelic pauseReplay];

Swift

NewRelic.pauseReplay()

Requirements

  • iOS agent v7.6.1 or higher.

    Description

    NewRelic.pauseReplay() can be called to manually force a replay to pause recording.

    If a replay is not already in progress, this API method will have no effect.

    If the mobile session is still valid, you can resume a paused replay by calling the newrelic.recordReplay() API method.

    Use Cases

  • You want to manually trigger a replay to stop recording on certain site pages or under certain conditions, such as a healthcare page, credit card info page, etc.

    Example

    Here's an example of forcing a replay to pause recording.

    Swift

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
// Pause session replay when entering confidential view
wasReplayPaused = NewRelic.pauseReplay()
}

Syntax

NewRelic.pauseReplay()

Requirements

  • React native v1.7.0 or higher.

    Description

    newrelic.pauseReplay() can be called to manually force a replay to pause recording.

    If a replay is not already in progress, this API method will have no effect.

    If the mobile session is still valid, you can resume a paused replay by calling the newrelic.recordReplay() API method.

    Use Cases

  • You want to manually trigger a replay to stop recording on certain site pages or under certain conditions, such as a healthcare page, credit card info page, etc.

    Example

    Here's an example of forcing a replay to pause recording.

NewRelic.pauseReplay()
Copyright © 2026 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.