Investigate background and resume behavior

Give Cordova/Capacitor session evidence foreground and background context when investigating behavior around app switching.

Lifecycle tracking helps you interpret events that occur as the app moves out of view or returns. Record those transitions with the session so foreground and background behavior can be reviewed in context.

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.