I am working with DeviceActivity to get the screen time. I always have screen time zero second (0s). But it should have some value.
I am selecting apps using familyActivityPicker and passing the tokens in the filter.
@State private var context: DeviceActivityReport.Context = .init(rawValue: "Total Activity")
filter = DeviceActivityFilter(
segment: .daily(
during: Calendar.current.dateInterval(
of: .weekOfYear, for: .now
)!
),
users: .all,
devices: .init([.iPhone, .iPad]),
applications: applications,
categories: categories,
webDomains: webDomains
)
DeviceActivityReport(context, filter: filter)
I saw various posts regarding this, but nothing working in my side. I am unable to identify the issue of getting zero second all the time.