Skip to main content

App Lifecycle

Generates: Events (Log Records)

Automatically emits a log event each time the app transitions between foreground, background, and created states. Enabled by default — no configuration required.

Events

Eventios.app.stateWhen
device.app.lifecycle"created"App process started (first launch or after system kill)
device.app.lifecycle"foreground"App moved to foreground (returned from background, or after "created")
device.app.lifecycle"background"App moved to background (home button, switch to another app)

Generated Telemetry

Type: Log Record (Event)
Event name: device.app.lifecycle

Attributes

AttributeValuesAlways Present
ios.app.state"created", "foreground", "background"✅ Yes
session.idCurrent session identifier✅ Yes

Sample Payload

{
"event_name": "device.app.lifecycle",
"attributes": {
"ios.app.state": "background",
"session.id": "f40364c92b85ec0c19c35a65be42b97f"
}
}

Disabling

config.appLifecycle { $0.enabled(false) }

Relationship to Sessions

App lifecycle events are what the Sessions instrumentation uses to detect background inactivity. A session expires when the app stays in "background" beyond the configured backgroundInactivityTimeout. Do not disable app lifecycle if you rely on session tracking.