App Lifecycle

Capture Cordova/Capacitor foreground and background state from document visibility and page events.

initialize(...) and initializeAndActivate(...) start lifecycle tracking unless lifecycle: false is supplied.

The integration maps visibilitychange, pageshow, and pagehide to the native lifecycle state. Control it explicitly with:

Ansight.startLifecycleTracking();
Ansight.stopLifecycleTracking();

await Ansight.setAppLifecycleState("foreground");

startAppStateTracking and stopAppStateTracking are aliases.