screen-time
Screen Time API
Parental controls, app limiting, and digital-wellbeing features on Apple platforms. One workflow, three frameworks that share a single entitlement (Family Controls) and a single opaque-token model: FamilyControls authorizes and selects, ManagedSettings restricts/shields, DeviceActivity schedules and monitors. The deep API references live in references/ (four files). This file is the decision and discipline layer: read it first, open the references for specifics.
Dials
Set these explicitly at the start; they change what "correct" means.
CAPABILITY—monitor-usage(DeviceActivity schedules + thresholds, observe only) ·shield-restrict(ManagedSettings shields/restrictions, block immediately) ·both(default for limiters: monitor until a threshold, then shield from the extension).SELECTION—app-tokens(ApplicationToken— block named apps the user picked) ·category-tokens(ActivityCategoryToken— block whole App Store categories, incl..all()/.all(except:)) ·mixed(apps + categories +WebDomainToken). Driven entirely by what the user picks inFamilyActivityPicker.PERSISTENCE—app-group(default and effectively required once an extension exists: encodeFamilyActivitySelection/token sets withPropertyListEncoder, store inUserDefaults(suiteName:)shared with theDeviceActivityMonitor/shield extensions) ·standard(only valid for an app with zero extensions — rare).
When to use
Building or reviewing any Screen Time feature: requesting Family Controls authorization, presenting the app picker, applying shields/restrictions, scheduling usage monitoring, or writing the DeviceActivityMonitor extension. Use this whether the app is a personal digital-wellness tool (.individual) or a parental-control app (.child). For displaying usage numbers, see the DeviceActivityReport note in references/overview.md — that data is only readable inside a report extension.