---
title: Pause replay
source: https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/pause-replay
---

## Android

### Syntax [#syntax]

#### Java [#java]

```java
NewRelic.pauseReplay()
```

#### Kotlin [#kotlin]

```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()`](https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/record-replay) 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 [#example]

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

    #### Java [#java]

```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 [#kotlin]

```kotlin
class MainActivity : AppCompatActivity() {

  ...
  var client: OkHttpClient = OkHttpClient();

      binding.fab.setOnClickListener { view ->

          NewRelic.pauseReplay()
          }
      }
    ...
```

## iOS

### Syntax [#syntax]

#### Objective-c [#objc]

```objective-c
      [NewRelic pauseReplay];
```

#### Swift [#swift]

```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()`](https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/record-replay) 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 [#example]

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

    #### Swift [#swift]

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

## React Native

### Syntax [#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()`](https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/record-replay) 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 [#example]

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

```
NewRelic.pauseReplay()
```
