I spent the last few months building Prayer Lock , an iPhone app that blocks distracting apps during a scheduled daily prayer time. The whole product rests on Apple's Screen Time API: FamilyControls , ManagedSettings and DeviceActivity . The documentation is thin and the sharp edges are real. This is the write-up I wish I had on day one.
The app is React Native (Expo) with a native Swift module, but almost everything below applies to a pure Swift app too.
The three frameworks and who does what
FamilyControls – authorization and the system app picker ( FamilyActivityPicker ). You never see bundle IDs; you get opaque ApplicationToken s.
ManagedSettings – the actual blocking. ManagedSettingsStore().shield.applications = tokens puts a system shield over those apps. Setting it to nil removes it.
DeviceActivity – schedules.…