Hey everyone,
I'm working on implementing an AppLimit, where after accumulating x minutes of Screen Time for an app, it should be blocked. It works fine on the first day, but stops functioning correctly on subsequent days.
What I'm Doing
-
I start a 24/7 schedule with a
DeviceActivityEventthat has a specified Screen Time threshold. -
In my
DeviceActivityMonitor, I'm reacting to theeventDidReachThreshold. Once the accumulated time is reached, the app is blocked. This works as expected on the first day.
Issues I'm Experiencing / Questions
- Second Day Issue: On the second day, the app is no longer blocked after the Screen Time
thresholdis reached, even though it worked on the first day. This leads me to suspect that aDeviceActivityEventis "consumable". Is this correct? - Pre-existing Screen Time Issue: If a user has already surpassed the Screen Time
thresholdbefore monitoring starts, the app isn't blocked once thescheduleis set up. This leads to 2 issues:
- I would expect that the accumulated amount of time after starting the schedule would result in the call of
eventDidReachThreshold. But it is never called - It could also be the case that the previously accumulated time is being kept in mind, but that would mean the apps should be blocked, which isn't the case.
Does the threshold account for accumulated Screen Time before the schedule begins? I haven't tested setting a limit of 10 minutes, accumulating 3 minutes of Screen Time, then starting the schedule and accumulating the remaining time, but I'm curious if anyone has encountered this behavior.
Does anyone have an explanation for this behavior? Any help would be greatly appreciated!