Menu

Post image 1
Post image 2
Post image 3
Post image 4
1 / 4
0

Building an iOS app blocker with Screen Time APIs

DEV Community·MN IN·about 1 month ago
#sR9HC8zm
#ios#swift#productivity#extension#apps#system
Reading 0:00
15s threshold

I recently built a small iPhone app called FocusLock. The idea is simple: choose distracting apps, create a rule, and let the phone enforce the boundary when it is time to focus. I built it because I kept running into the same problem with my own phone habits. I did not need a bigger productivity system. I needed fewer tiny negotiations with myself. This post is mostly about the technical side: what it is like to build this kind of app on iOS, what Apple gives you through the Screen Time APIs, and the tradeoffs I ran into while building the first version. The main frameworks FocusLock is built around a few Apple frameworks: FamilyControls ManagedSettings DeviceActivity UserNotifications SwiftUI At a high level: FamilyControls lets the user choose apps or app categories through Apple's system picker. ManagedSettings lets the app apply shields to the selected apps/categories. DeviceActivity lets the system wake an extension when a scheduled interval starts or ends.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More