DeviceActivityEvent with threshold spanning over midnight → threshold not working

Hello,

I am using a DeviceActivityEvent to limit access to an app after the user has spent x minutes on it.

Sometimes it can happen that a DeviceActivitySchedule spans from 11:55pm - 12:25am (just an example).

In these cases, I have noticed, the DeviceActivityMonitorExtension’s eventDidReachThreshold is not called after the user has reached the threshold time interval in the observed app.

I assume this is because we have transitioned over midnight and something weird happens to the DeviceActivitySchedule.

I’ve tried adding the day components to the DeviceActivitySchedule as well, but then it fails completely.

Any advice how to handle this?

I could, of course, create two separate DeviceActivitySchedules: one for before midnight, and one for after. But depending on the user’s real app usage that could lead to slightly different (and unexpected) behavior.

DeviceActivityEvent with threshold spanning over midnight → threshold not working
 
 
Q