Search results for

DeviceActivityReport

118 results found

Post

Replies

Boosts

Views

Activity

Reply to [iOS 17] Screen Time connection breaks randomly multiple times per day
We experience the same issue on our app, and we filled a bug report as well -> FB12235755. The issue seems to happen when screentime permission have been granted prior to iOS 17. In our testing, everything based on DeviceActivityReport fails to render until you reinstall the app. here's what we see in the logs: Failed to discover the client's extension: Error Domain=DeviceActivityReportService.ReportViewController.ClientError Code=2 (null) VS terminated with error: Error Domain=_UIViewServiceErrorDomain Code=1 (null) UserInfo={Terminated=disconnect method} I agree this is a big concern for us as well, we don't want to ask all of our users to reinstall the app after updating to iOS 17. This is also showing how little control we have on DeviceActivityReport views, we cannot know if they are loading, if they errored with the public API, we opened a enhancement radar on this about a year ago (FB10754858).
Topic: App & System Services SubTopic: General Tags:
Jun ’23
How to find out if an app extension process is alive on iOS?
Hey 👋 I have an extension of type Device Activity Report Extension. Is there a way to know from the parent app if the extension process is alive? the process name is DeviceActivityReportService Why would I like to detect that? The extension sometimes crashes due to memory pressure and I would like to reload the view automatically when this happens. This issue happens under normal app use — the user switches quickly between two tabs that have DeviceActivityReport. I filed a bug for this with a sample project to replicate (12192929) Here is an output from the Console app when the DeviceActivityReportService is killed and the UI disappears: kernel memorystatus: killing process 33061 [DeviceActivityReportService] in high band FOREGROUND (100) - memorystatus_available_pages: 68660 kernel DeviceActivityReportService[33061] Corpse allowed 1 of 5 SpringBoard [xpcservice<com.apple.DeviceActivityUI.DeviceActivityReportService([application<com.labalab.Screen-Time.marcin>:33046])>:33061] Workspace c
2
0
1.7k
Jun ’23
How long is DeviceActivityData accessible in DeviceActivityReport?
Using the DeviceActivity framework we are able to display data based on a user's screentime and device usage. With the DeviceActivityFilter property, you can specify the date interval to collect data between. In testing, it seems that data only becomes accessible once the extension has been installed (so the extension isn't reading the screentime data already collected on device). However, once installed, I'm curious how far back you can query data from in the data interval? Opal which uses the Screentime API appears to have a lifetime Screentime metric, so hypothetically it should possible to query data as far back as collection starts. Unless they are getting around the sandbox environment and storing the data somehow. Side note on Opal -- They seem to have a community average of Screentime among people in the same age group. Does anyone know how they are collecting the data for this average? Is it actually using live Screentime data or just aggregating data from other studies?
2
0
1.1k
May ’23
Switching tabs crashes "Screen Time" process
I think I have found a bug in the Apple Screen Time API. I have filed it via a Feedback Assistant, but I can see that some apps have somehow found a workaround to this issue — so wondering how they did it. The issue: Create a simple two tabs view: TabView { Tab1View() .tabItem { Label(Tab 1, systemImage: 1.circle.fill) } Tab2View() .tabItem { Label(Tab 2, systemImage: 2.circle.fill) } } Each tab has a different Screen Time report, e.g. struct Tab2View: View { var body: some View { DeviceActivityReport(Utils.weeklyContext, filter: Utils.filterWeekly) } } When you switch the tabs quickly, the Screen Time process crashes, leaving both reports blank. The size of the DeviceReportActivity remains the same (it's just blank), so there is no way to tell if it crashed. Also, there is no way to know that the Screen Time process has crashed. This leaves the app in an unusable state. Here is a video illustrating the issue: https://www.youtube.com/watch?v=WrRpohf9tmw&ab_channel=MarcinCzech The code is here: ht
0
0
666
May ’23
Token Selection from DeviceActivityReport
I'd like to allow users to select apps to shield from a DeviceActivityReport (similar to how Apple's Screen Time Settings activity report allows a user to add limits to a selected app in the report. What I need to do is pass an appToken from the DeviceActivityReportExtension to my app. I realize the extension is sandboxed and doesn't allow private data to be seen outside of the sandbox. The docs state: To protect the user’s privacy, your extension runs in a sandbox. This sandbox prevents your extension from making network requests or moving sensitive content outside the extension’s address space. However, tokens aren't sensitive. I want to pass a token set out of the sandboxed extension so users can select certain apps from the report that my app can use for setting limits, etc. I thought using App Groups and saving data with UserDefaults with a suiteName for my app group would do it, but it doesn't appear to allow me to pass the token data. Yes I'm using the same KEY for both as I set a config enum
1
0
947
May ’23
Terminate and re-launch DeviceActivityReport Extension
The DeviceActivityReport is often laggy or sometimes doesn't show up at all. Quitting and re-opening the app usually fixes this problem. I'm wondering, is there a way to programmatically terminate and then re-launch the DeviceActivityReport App Extension from the host app? This way, that could act as a refresh when the DeviceActivityReport fails to show up.
0
0
918
May ’23
DeviceActivityReport Lag
There have been several posts (i.e. here, here) about the lagginess of the DeviceActivityReport extension. Often it takes a few seconds for the view to load, or sometimes doesn't show up at all. I've confirmed this is not a case of excessive memory usage in the extension (exceeding 100MB), because I've profiled the extension and it consistently maxes out at 10MB. I've placed a loading screen behind the DeviceActivityReport inside a ZStack in the host app in order to see if the lag is because it takes some time for the extension to spin up - but the loading screen does not appear, indicating that the extension is running right away, but receiving the view from the extension in the host app is where the lag happens. It's been extremely difficult to debug because the lag only occurs a fraction of the time, and DeviceActivityReport is pretty much a black box. There's no documentation about how the host app and extension actually communicate. I've also combed through the logs using the C
4
0
1.9k
Apr ’23
DeviceActivity App Extension Lifecycle
I've asked several questions about DeviceActivity performance issues where the answers have cited limitations to the lifecycle of the DeviceActivity App Extensions. For example: Question about DeviceActivityReport lag and performance issues responded letting me know that my extension may be exceeding its memory limit of 100MB and subsequently getting terminated by the system. Question about async tasks in DeviceActivityMonitor responded letting me know that the monitor extensions lifecycle ends and is terminated by the system once all synchronous functions return, so it has no async support. I couldn't find either of these facts documented anywhere, and the DeviceActivity docs mention very little about how the extensions actually work. In general, it seems like these app extensions are basically a black box. Is there any additional comprehensive documentation about the true lifecycle of the app extensions, their limitations, and how apps should handle error cases (like the system terminating the app
1
0
978
Mar ’23
Reply to DeviceActivityReport lag and performance issues
It sounds like your extension is exceeding its memory limit of 100MB and subsequently getting terminated by the system. I'd recommend trying to reduce your extension's memory usage. We are aware of the gesture limitations of DeviceActivityReports, as they are views rendered by a different process than the parent app. However we'd still really appreciate an enhancement request using Feedback Assistant because it helps our team determine which enhancements and bug fixes to prioritize. Thanks in advance!
Topic: Privacy & Security SubTopic: General Tags:
Mar ’23
DeviceActivityReport lag and performance issues
I've been experiencing some serious performance issues with DeviceActivityReport. Their severity tends to vary across devices - for some of my users it's really bad and for some it's mostly fine - but every device seems to experience these issues at some point. 1. DeviceActivityReport is completely blank. Often on launch, the DeviceActivityReport is completely blank and the only way to make it show up is to click back and forth between tabs, or quit the app and re-open it. Sometimes, it will show up after one or two seconds, but that is still a bad user experience. When looking at logs during this issue, I can see that makeConfiguration still runs successfully and returns a value, so I suspect the issue is with the rendering of the View in the App Extension. 2. Gestures are slow to register, or can't register at all. For example, if I place my DeviceActivityReport inside a ScrollView, I cannot scroll if I perform the gesture on the report view. If I try to scroll on the par
3
0
2.0k
Mar ’23
DeviceActivityReport shows 0 screen time data during a daily segment interval
Since Monday March 13 2023, DeviceActivityReport with a daily segment filter shows 0 screen time, for all users of my app (there are thousands). When changing the segment to hourly, it works but performance suffers. I've defined the filter like this: @State private var filter = DeviceActivityFilter(segment: .daily(during: DateInterval( start: Calendar.current.startOfDay(for: .now), end: .now))) Is anybody else experiencing this? This happened on its own after no change in the code or update to the app, and seems to be correlated with the first full day of Daylight Savings. I will file a bug in Feedback Assistant, but is there any other guidance you can give on what might be the root cause, and if there's a fix? Seems like a large issue. Thanks in advance!
1
0
1.2k
Mar ’23