Post

Replies

Boosts

Views

Activity

Comment on Loading indicator until DeviceActivityReport renders?
I've experienced the same thing consistently in my application. @foijodsf let me know if you've filed the bug and please link it here! It seems like there are apps that have been able to get around the lag (like Jomo for example, which never lags at all) - so there seems to be an existing way to anticipate the lag and re-render Scene. Kmart, could you shed any light on how to get around the frequent lag of DeviceActivityReport?
Jan ’23
Comment on DeviceActivityReport shows 0 screen time data during a daily segment interval
Thanks for the response! A few questions: 1. Is there an estimated release date for the iOS version when this should be fixed? 2. By "deauthorize and re-authorize" the app, I assume you mean have the user revoke Screen Time access in the app's settings. This worked for some users, but did not work on my device (which is developer enabled). Is this a sure fix? 3. Since revoking Screen Time access is supposed to fix this, should this be a problem for new users?
Mar ’23
Comment on DeviceActivityReport lag and performance issues
Thanks for your response Kmart! While profiling the extension in Xcode, it maxes out at around 10MB on my device. I've also ensured that I'm looking at the extension target and not the host app. Could the memory usage vary that widely on other users devices that it could exceed 100MB while my device maxes out at 10? Or might there be something else going on?
Mar ’23
Comment on Setting values in UserDefaults in DeviceActivityMonitor extension
I'm storing timestamps of certain screen time thresholds with DeviceActivityMonitor. Whether or not this is its intended use, something is still off. DeviceActivityMonitor is part of an app extension that is invoked and terminated by the system. Once its functions return, the extension is immediately terminated, meaning there may be data in UserDefaults that never gets persisted. The also docs don't say it's a no-op just that it's "unnecessary" - but maybe it's necessary inside an app extension?
Apr ’23
Comment on Setting values in UserDefaults in DeviceActivityMonitor extension
Thanks for the clarification! Is there a doc that says that? The docs I linked state that the data is persisted asynchronously. Also, the DeviceActivityMonitor extension is allowed to access UserDefaults, since it doesn't have access to granular screen time data like specific apps. It's the DeviceActivityReport extension that has these restrictions. Defaults set in the monitor extension are usually propagated to my app, but sometimes not, which led me to think it was a concurrency issue.
Apr ’23
Comment on Detecting Termination and Re-establishing Connection with DeviceActivityReport App Extension
Thanks for the reply! Already have reload capabilities in my app but it's still a terrible user experience for the report to show up blank so often. Seems like other screen time apps have been able to mitigate this issue mostly, but not sure what their workarounds are. I'm thinking of creating a group chat for iOS screen time devs to troubleshoot together since the APIs are still pretty buggy and it's hard to get answers from Apple. If you're interested, email me at screentimedev23 @ gmail.com
Sep ’23
Comment on Detecting Termination and Re-establishing Connection with DeviceActivityReport App Extension
I've been able to manually refresh the report UI by incrementing an id: @State var reportId = 0 ... DeviceActivityReport(context, filter: filter) .id(reportId) Button(action: { reportId += 1 }) { Text("Refresh") } However, what I really want to do is detect from the host app when the app extension or DeviceActivityReportService gets terminated, and then programmatically refresh the view. Has anyone been able to figure out how to detect termination of the extension?
Sep ’23
Comment on DeviceActivityMonitor event threshold callbacks often triggered multiple times in a row
However, I do interact with UserDefaults in the callback functions. And sometimes actions that are meant to be performed in the callback functions do not occur, indicating failure. I think it's likely that the callback functions are failing at some point and being retried, and so notifications get sent multiple times. But it's very difficult to debug these situations because of limited access to the app extension. Any advice?
Dec ’23