DeviceActivityReport inconsistencies

Hello, I want to echo the DeviceActivityReport "concurrency" problems flagged in https://developer.apple.com/forums/thread/720549, and ask a related question. (Thanks to Kmart and other Apple dev support folks who have been monitoring these forums and responding diligently.)

I would like to display daily and weekly stats in the same view, broken down by specific apps (as in the native Screen Time). However, instantiating multiple DeviceActivityReport objects with different filters and/or different contexts leads to confusion, where the two views will incorrectly and intermittently swap data or duplicate data where it shouldn't (seemingly upon some interval when the extension provides fresh data). There isn't documentation on how to display multiple reports at once. Is the idea that logic for multiple reports should be embedded within the extension itself in the makeConfiguration() function and there should only be a single DeviceActivityReport in the main App, or is this a bug?

Even with a single DeviceActivityReport, I run into inconsistencies where the View provided by the extension takes multiple seconds to load or fails to load altogether. The behavior seems random...I will build the application with the same code multiple times and see different behavior each time.

Finally, a plug for better support in the Simulator for the entire set of Screen Time APIs.

Thanks!

While we encourage developers to only have one report on-screen at a time for performance reasons (this is how the API was initially intended to be used), we do see the potential use-cases for multiple reports (e.g. a report in each tab of a TabView or multiple reports stacked on top of one another on a nav stack). We are working on a fix for FB11725142, which will enable developers to have multiple reports with different filters on-screen at once.

Please file an enhancement request for improved simulator support using Feedback Assistant. Thanks in advance!

DeviceActivityReport inconsistencies
 
 
Q