App Lifecycle
Capture React Native foreground and background state from JS AppState or explicit calls.
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".