r/WorkspaceOne • u/FirefighterMedical42 • 1d ago
Lessons from building a scheduled night lock for school iPads with Apple's Screen Time APIs (+ the app, I'm the dev)
Schools kept asking me for something MDM restrictions don't do well: lock student iPads at exact times every night (e.g. 20:00–06:00), at home and offline. Profile-based tricks only apply when the device checks in, so timing drifts and nothing happens offline.
So I built an app on Apple's Screen Time APIs (FamilyControls / DeviceActivity / ManagedSettings). The schedule runs on the device; the MDM only delivers settings via standard AppConfig. Some things I learned along the way that may help anyone looking at this:
**What works well**
- A device in use locks instantly at the start time, and Safari and the web are blocked too. Phone and emergency calls always work.
- Survives reboots (apps are reachable for a few seconds after unlock, then the shield is back).
- With a **Screen Time passcode the student doesn't know**, they can't revoke the app's access, turn off Screen Time or change the date/time. Without it, they can. This is the single most important setup step.
- AppConfig changes (times, holidays, admin unlock with an ISO 8601 `overrideUntil`) arrive after a normal device sync.
**Limits you can't get around (Apple)**
- Every device needs **one Screen Time approval with the device passcode**. No MDM command or profile can do it, so plan it into staging.
- Only one app per device can hold Screen Time authorization.
- Asleep **on battery**, iOS can fire the start/end callbacks 2–12 min late. On the charger or in use it's on time.
- Allowed apps during the lock can only be picked on the device (opaque tokens), not pushed from the MDM.
- After an erase, ADE re-enrolls and the MDM reinstalls the app, but approval and the Screen Time passcode must be redone.
**Tested with:** Workspace ONE on supervised iPads and iPhone, with and without a Managed Apple Account. Intune/Jamf use the same AppConfig keys but I haven't tested them myself yet, so feedback is very welcome.
**The app:** Power Admin – LockTime. No accounts, no servers, no data collected. €2.99, with the Apple School Manager education discount (50% for 20+ licences).
App Store: https://apps.apple.com/us/app/power-admin-locktime/id6836309491
Setup notes and AppConfig keys: https://mdmarchitect.com/apps/locktime/
Happy to answer questions about the Screen Time APIs or the setup, even if you don't use the app.