Is Screen Time trapped inside DeviceActivityReport on purpose?

I can see the user’s real daily Screen Time perfectly inside a DeviceActivityReport extension on a physical device.

It’s right there.

But the moment I try to use that exact total inside my main app (for today’s log and a leaderboard), it dosnt work.

I’ve tried, App Groups, Shared UserDefaults, Writing to a shared container file, CFPreferences

Nothing makes it across. The report displays fine, but the containing app never receives the total. If this is sandboxed by design, I’d love confirmation. Thanks a lot

Answered by DTS Engineer in 878084022
Is Screen Time trapped inside DeviceActivityReport on purpose?

Yes.

Some app extensions handle extremely sensitive data that shouldn’t leave the device. The system runs such appexen in a read-only sandbox, so that the appex can’t export that sensitive data to other code with a less restrictive sandbox.

I’m more familiar with this idea in the context of Network Extension content filters, where the docs clearly explain this concept. However, I’ve seen the same technology used for numerous other appex types, and it certainly looks like this includes Device Activity report extensions.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer
Is Screen Time trapped inside DeviceActivityReport on purpose?

Yes.

Some app extensions handle extremely sensitive data that shouldn’t leave the device. The system runs such appexen in a read-only sandbox, so that the appex can’t export that sensitive data to other code with a less restrictive sandbox.

I’m more familiar with this idea in the context of Network Extension content filters, where the docs clearly explain this concept. However, I’ve seen the same technology used for numerous other appex types, and it certainly looks like this includes Device Activity report extensions.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Is Screen Time trapped inside DeviceActivityReport on purpose?
 
 
Q