React Native App Lifecycle Events

Reteno SDK can automatically track application lifecycle and track events that described below.

Track AppLifecycle Events

When app lifecycle tracking is enabled in lifecycleTrackingOptions (appLifecycleEnabled), Reteno tracks the following events:

Event NamePropertiesDescription
ApplicationInstalledversion, buildThis event fires when a user opens the application for the first time right after installation
ApplicationUpdatedversion, build, previousVersion, previousBuildThis event fires when a user opens the application after updating the application
ApplicationOpenedfromBackgroundThis event fires when a user launches or foregrounds the application after the first open
ApplicationBackgroundedapplicationOpenedTime, secondsInForegroundThis event fires when a user backgrounds the application

Track Push Subscription Events

When push subscription tracking is enabled in lifecycleTrackingOptions (pushSubscriptionEnabled), Reteno tracks the following events:

Event NameDescription
PushNotificationsSubscribedThis event fires when a customer susbribes for push notifications
PushNotificationsUnsubscribedThis event fires when a customer unsusbribes from push notifications

Track Session Events

When session tracking is enabled in lifecycleTrackingOptions (sessionStartEventsEnabled / sessionEndEventsEnabled), Reteno tracks the following events:

Event NamePropertiesDescription
SessionStartedsessionId, startTimeThis event fires when a user's session started
SessionEndedsessionID, endTime, durationInSeconds, applicationOpenedCount, applicationBackgroundedCountThis event fires when a user's session ended

Configure Lifecycle Tracking in React Native

Use initialize(...) and pass lifecycleTrackingOptions.

import { initialize } from "reteno-react-native-sdk";

await initialize({
  apiKey: "YOUR_SDK_ACCESS_KEY",
  lifecycleTrackingOptions: {
    appLifecycleEnabled: true,
    foregroundLifecycleEnabled: false,
    pushSubscriptionEnabled: true,
    sessionStartEventsEnabled: true,
    sessionEndEventsEnabled: false,
  },
});

You can also pass shortcut values:

  • "ALL" to enable all lifecycle categories
  • "NONE" to disable all lifecycle categories