Investigate background and resume behavior

Add React Native foreground and background state to session evidence to understand issues around app switching and resume.

Lifecycle changes provide context for the events and telemetry around a problem. Record when your app enters the background or returns to the foreground so you can review those transitions alongside the session.

The bridge starts JavaScript AppState tracking after initialize(...) or initializeAndActivate(...) unless lifecycle is set to false.

await Ansight.initializeAndActivate({
  lifecycle: true,
});

Manual Control

Ansight.startAppStateTracking();
Ansight.stopAppStateTracking();

Set lifecycle state explicitly when app code owns the state model:

await Ansight.setAppLifecycleState("foreground");
await Ansight.setAppLifecycleState("background");

Supported states are "unknown", "foreground", and "background".