Skip to content

feat(mobile): App Lock with Face ID, Touch ID, or passcode - #72

Open
pseudoseed wants to merge 1 commit into
mainfrom
t3/ios-app-lock-timeout
Open

pseudoseed wants to merge 1 commit into
mainfrom
t3/ios-app-lock-timeout

Conversation

@pseudoseed

Copy link
Copy Markdown
Owner

Anyone holding an unlocked phone could open the app and read every thread. App Lock requires device authentication to open it after it has been away for a chosen time.

What it does

  • Settings > App Lock: on/off, then lock after leaving the app: immediately, 1, 5, 15 minutes, or 1 hour (default 1 minute).
  • Face ID / Touch ID / Optic ID, falling back to the device passcode.
  • Turning it off or picking a longer time asks to unlock first; picking a shorter time does not.

How

  • The lock is native (T3AppLock in t3-native-controls). Its cover window sits above every app window, goes up on resign-active so the app switcher snapshot shows the cover, and is up on cold launch before React loads.
  • Background time uses CLOCK_MONOTONIC (counts through sleep, ignores clock changes). A reboot, a crash while open, or no background record means locked.
  • While covered, app windows are hidden from VoiceOver, the cover takes key focus, and the keyboard is dismissed so its suggestion bar cannot echo typed text into the snapshot.
  • If the device passcode is removed, the lock turns itself off (removing it takes the passcode).
  • Notifications, widgets, and Live Activities keep their content; the settings page says so.
  • Android code is included and passes ktlint/detekt, but it has never been compiled, and we don't build Android.

Verified

  • vp run check:changed passes on Node 26 (format, lint, typecheck, knip, tests, React Compiler).
  • iOS dev client builds clean. On the iPhone simulator: turning it on, the shorter-time and longer-time rules, cancelling keeps the old value, a quick return stays unlocked, a return after the timeout locks, Face ID failure then Cancel shows the Unlock button, taps under the cover do nothing, cold launch locks, the accessibility tree shows only the cover, turning it off works.

🤖 Generated with Claude Code

Settings > App Lock requires device authentication to open the app after it
has been away for a chosen time (immediately, 1, 5, 15 minutes, or 1 hour).

The lock lives in native code (t3-native-controls) so it covers the app before
React loads, sits above native presentations and modals, and keeps content out
of the app switcher snapshot. Background time uses a monotonic clock that keeps
counting through sleep and ignores wall-clock changes; a reboot, a crash while
open, or a missing record always locks. Turning the lock off or lengthening the
timeout requires authentication. VoiceOver cannot read the app under the cover.

Notifications, widgets, and Live Activities keep their content, and the
settings page says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. 📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. size:XXL labels Nov 24, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. size:XXL vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant