Cordova App Lifecycle Events

Reteno can automatically track app lifecycle, foreground lifecycle, push subscription, and session events.

Tracked App Lifecycle Events

When appLifecycleEnabled is enabled:

  • ApplicationInstalled
  • ApplicationUpdated
  • ApplicationOpened
  • ApplicationBackgrounded

Tracked Foreground Lifecycle Events

When foregroundLifecycleEnabled is enabled:

  • ApplicationOpened
  • ApplicationBackgrounded

Tracked Push Subscription Events

When pushSubscriptionEnabled is enabled:

  • PushNotificationsSubscribed
  • PushNotificationsUnsubscribed

Tracked Session Events

When sessionStartEventsEnabled / sessionEndEventsEnabled are enabled:

  • SessionStarted
  • SessionEnded

Configure Lifecycle Tracking

Configure during initialization:

RetenoPlugin.init({
  lifecycleTrackingOptions: {
    appLifecycleEnabled: true,
    foregroundLifecycleEnabled: false,
    pushSubscriptionEnabled: true,
    sessionStartEventsEnabled: true,
    sessionEndEventsEnabled: false,
  },
});

Or with shortcuts:

RetenoPlugin.init({ lifecycleTrackingOptions: 'ALL' });
RetenoPlugin.init({ lifecycleTrackingOptions: 'NONE' });

You can also call:

RetenoPlugin.setLifecycleTrackingOptions({
  sessionStartEventsEnabled: true,
  sessionEndEventsEnabled: true,
});
RetenoPlugin.setLifecycleTrackingOptions('ALL');
RetenoPlugin.setLifecycleTrackingOptions('NONE');

iOS note: setLifecycleTrackingOptions(...) must be called before init().
Legacy note: sessionEventsEnabled is still supported as an alias that toggles both session start and end events.

Screen Tracking in Cordova

For Cordova apps, manual screen tracking is recommended:

RetenoPlugin.logScreenView('HomeScreen');

Automatic native screen tracking in hybrid WebView apps does not reflect JS route changes.