unlock_detector library

Detects device lock/unlock, app foreground/background, idle and screen state — for user online/offline presence.

Platform coverage:

  • foreground / background / idle — all platforms. On Android and iOS this tracks the app lifecycle; on web and desktop it tracks window focus/blur (a focused window is foreground, a blurred or minimized one is background).
  • locked / unlocked / screenOn — Android and iOS only.

Classes

UnlockDetector
Detects device and app presence state.

Enums

UnlockDetectorStatus
Presence and device statuses emitted by UnlockDetector.

Exceptions / Errors

UnlockDetectorException
Thrown when an UnlockDetector operation fails.