I am still struggling to nail down the screen time between monitoring and showing it in a DeviceActivityReport. It's always off by a couple of percentage points, which results in a difference of a couple of minutes between the time shown for my total screen time in DeviceActivityReport and DeviceActivityMonitor with a threshold set for all apps/websites/categories.
In the report, I am looping through all segment (there is only 1 segement using .daily segment interval for a given day) then loop through all categories and all apps within each category and sum up all totalActivityDuration for each app. Based on avaiable documentation, that should corrolate to DeviceActivityMonitor threshold but it doesn't. Are there any differences in how these 2 places count screen time? Are there any apps/core ios services which are excluded from DeviceActivityMonitor. Would appreciate any help at all, I'm losing my mind here.
My current suspicion is that Apple Developer documentation is counted twice. i.e. this website https://developer.apple.com/documentation/deviceactivity/deviceactivitymonitor shows up in usage as an App with bundleId of apple.developer.wwdc-release and time spent there is counted twice, against this bundleId AND Safari. I don't know why it's not counted as a webdomain.