Skip to main content
The SDK includes a batched event tracking system that automatically collects lifecycle events and supports custom event tracking.

How It Works

The EventService queues events in memory and flushes them in batches of 20 every 30 seconds:
  1. track() adds an event to the pending queue
  2. When the queue reaches 20 events, it flushes immediately
  3. Every 30 seconds, any pending events are flushed
  4. If a flush fails, events are persisted to AsyncStorage and retried on next init
  5. On StackfrontProvider unmount, the flush timer stops; pending events remain persisted in AsyncStorage and are replayed on next init

Automatic Events

Supported Event Types

The events API keeps an allow-list and silently drops any event type not on it. The exact supported set is:

Custom Events

Event Shape

The sessionId is generated once when the provider mounts and persists for the app session.

Identity & attribution

The provider wires the player id (from push registration) and the customer id (from login) into the event queue automatically — every tracked event carries them when available, with no extra work from the host app. The backend uses oneSignalPlayerId for distinct-user and realtime “active users” counts and customerId to tie activity to a customer; events tracked before push registration or login simply omit the fields.

Service API

Best Practices

  • Use descriptive event names in snake_case
  • Limit properties to primitive types and flat structures
  • Avoid tracking personally identifiable information (PII) in properties
  • The event pipeline is fire-and-forget — errors are silently handled and retried