> ## Documentation Index
> Fetch the complete documentation index at: https://docs.basset.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# app.state

> Whether the app was in front, and how long it was away

Subscribes to UIKit's app-lifecycle notifications. A reading each time the
app moves to the foreground, the background, or resumes from one.

| | |
| - | - |
| [Delivery](/instruments/metadata) | stream, onChange |
| Mechanism | notification |
| [Requires](/instruments/metadata) | iOS 17+, basset 0.1.1+ |

Real output from `basset request get`, captured against a running app:

```
CAPTURED                  ELAPSED  INSTRUMENT

launch 12909160989600416811
2026-08-23T14:52:16.394Z  +0.0s    lifecycle.app.state(appLifecycle)
└─ appState          foreground
2026-08-23T14:52:22.717Z  +6.3s    lifecycle.app.state(appLifecycle)
└─ appState          background
2026-08-23T14:52:30.937Z  +14.5s   lifecycle.app.state(appLifecycle)
└─ appState          foreground
2026-08-23T14:52:31.249Z  +14.9s   lifecycle.app.state(appLifecycle)
├─ appState          resumed
└─ totalNanoseconds  8531486500
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.