Syntax
Java
NewRelic.recordReplay()Kotlin
NewRelic.recordReplay()Requirements
Android agent v7.7.0 or higher.
Description
NewRelic.recordReplay()can be called to manually force a replay to begin recording. You must meet the following requirements:Account is entitled to record replays
If a replay is already in progress, or not all of the above criteria are met, this API method will have no effect.
For information about pausing and resuming a replay, refer to
NewRelic.pauseReplay()Use Cases
You want to manually trigger a replay to record on certain site pages or under certain conditions, regardless of the sampling settings.
Example
Here's an example of forcing a replay to start recording.
Java
public class MainActivity extends Activity { ... @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.record_replay: NewRelic.recordReplay(); ... return true; default: return super.onOptionsItemSelected(item); } } ...}Kotlin
class MainActivity : AppCompatActivity() {
... var client: OkHttpClient = OkHttpClient();
binding.fab.setOnClickListener { view ->
NewRelic.recordReplay() } } ...Syntax
Objective-c
[NewRelic recordReplay];Swift
NewRelic.recordReplay()Requirements
iOS agent v7.6.1 or higher.
Description
NewRelic.recordReplay()can be called to manually force a replay to begin recording. You must meet the following requirements:Account is entitled to record replays
If a replay is already in progress, or not all of the above criteria are met, this API method will have no effect.
For information about pausing and resuming a replay, refer to
NewRelic.pauseReplay()Use Cases
You want to manually trigger a replay to record on certain site pages or under certain conditions, regardless of the sampling settings.
Example
Here's an example of forcing a replay to start recording.
Swift
override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) // Resume session replay only if we successfully paused it, we only want to start the replay back up if it was recording already if wasReplayPaused { let resumed = NewRelic.recordReplay() wasReplayPaused = false } }Syntax
NewRelic.recordReplay()Requirements
React Native v1.7.0 or higher.
Description
NewRelic.recordReplay()can be called to manually force a replay to begin recording. You must meet the following requirements:Account is entitled to record replays
If a replay is already in progress, or not all of the above criteria are met, this API method will have no effect.
For information about pausing and resuming a replay, refer to
NewRelic.pauseReplay()Use Cases
You want to manually trigger a replay to record on certain site pages or under certain conditions, regardless of the sampling settings.
Example
Here's an example of forcing a replay to start recording.
NewRelic.recordReplay();