Search results for

DeviceActivityReport

118 results found

Post

Replies

Boosts

Views

Activity

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 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
DeviceActivityReport not playing nicely with NavigationStack
DeviceActivityReport does not seem to re-render properly when a subview is popped off of a NavigationStack. The following code (with the extension code generated directly from XCode boilerplate) renders the device activity report when the app loads, but after the button is pressed and the new subview is dismissed, the device activity view becomes blank. I don't see the same behavior with a modal like .sheet(). XCode 14.2 (14C18), iOS 16.3 beta (20D5035i) import SwiftUI import DeviceActivity extension DeviceActivityReport.Context { static let totalActivity = Self(Total Activity) } struct OtherContentView: View { var body: some View { VStack {} } } struct ContentView: View { let context: DeviceActivityReport.Context = .totalActivity let filter = DeviceActivityFilter( segment:.daily( during: DateInterval( start: Date().addingTimeInterval(-24 * 3600), end: Date() ) ) ) var body: some View { NavigationStack { List { NavigationLink(destination: { OtherContentView() }, label: { Text(Press Me) }) DeviceActivityReport
2
0
2.1k
Feb ’23
Reply to How to detect Device activity on iOS ?
Yes, you can use the FamilyControls framework's AuthorizationCenter to request access to the DeviceActivity framework. Once the user grants your app access to Screen Time data, it can use a DeviceActivityReport rendered by your app's Device Activity Report extension to display usage data for that device.
Topic: App & System Services SubTopic: General Tags:
Feb ’23
Reply to Cannot get DeviceActivityReport to work
Leaving this here for the next person who needs help: lets say you have this in your context: extension DeviceActivityReport.Context { // If your app initializes a DeviceActivityReport with this context, then the system will use // your extension's corresponding DeviceActivityReportScene to render the contents of the // report. static let totalActivity = Self(totalActivity) } You have to put this in your actual app AND in your DeviceActivityReport extension.
Topic: Privacy & Security SubTopic: General Tags:
Feb ’23
Reply to Get Screentime Data without charts
In order to preserve the user's privacy, your app cannot fetch device activity data directly. Instead, you must implement a Device Activity report app extension that conforms to the DeviceActivityReportExtension protocol. In order to create a new extension, click File > New > Target... > iOS > Device Activity Report Extension in Xcode. Your app can then create and display a DeviceActivityReport. The UI for this view can be as simple as some text displaying the total usage time or as complex as a pie chart.
Topic: App & System Services SubTopic: General Tags:
Jan ’23
Reply to Family Activity Picker | Screen Time API features iOS 16
You can use a Label to display the icon and name of apps selected in a FamilyActivityPicker: https://developer.apple.com/documentation/familycontrols/displayingactivitylabels Alternatively, it is also possible to display the localized names and bundle identifiers (as well as usage data) for apps selected by the user in a FamilyActivityPicker by creating a Device Activity report app extension and then displaying a DeviceActivityReport with a filter containing the desired tokens.
Topic: App & System Services SubTopic: General Tags:
Jan ’23
Screen Time discrepancy between DeviceActivityMonitor and DeviceActivityReport
My app monitors DeviceActivityEvents with no categories, apps, or websites selected because we want to monitor their time spent on all categories, apps, and websites. This is because my app gives users rewards for keeping their total Screen Time low. Unfortunately, it has been seemingly impossible to align the Screen Time shown with DeviceActivityReport to the Screen Time monitored with DeviceActivityMonitor. By default, the DeviceActivityReport captures more Screen Time than the DeviceActivityMonitor by default. But if I try to filter the report by totalActivityDuration on each category, it misses some Screen Time captured by the monitor (like FaceTime, for instance). I simply want to report to the user exactly the Screen Time I am monitoring by default with DeviceActivityMonitor. Is that possible without selecting any categories, apps, or websites in the monitor?
2
0
1.2k
Dec ’22
Reply to I could not show Device Activity Report in my App
I enabled Screen Time in parent, for monitoring child devices uses. In order to report child usage on a parent's device, you must ensure that your app is properly entitled and authorized for Family Controls on the child devices using an AuthorizationCenter. The question is How can I show usage of the apps in my App with customized SwiftUI views? as I said I did lots of suggestions but I could not implemented. If you click File > New > Target... > iOS > Device Activity Report Extension in Xcode, it will create a simple Device Activity Report extension. Then, your app can create a DeviceActivityReport with a DeviceActivityFilter that specifies activity data for .children. Your extension will then be provided the data for the parent's children and can use this data to render the contents of the report.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’22
I could not show Device Activity Report in my App
Hello I would like to show my children devices activity reports on the parent device.Im using. family controls. -I enabled Screen Time in parent, for monitoring child devices uses. -I implemented Device Activity Monitor extension on my project And also I added to that code samples, but I could not understand how its working. https://developer.apple.com/documentation/deviceactivity/deviceactivityreport In WWDC there an example for that named Worklog in here, but there is so many missing informations https://developer.apple.com/videos/play/wwdc2022/110336/ The question is How can I show usage of the apps in my App with customized SwiftUI views? as I said I did lots of suggestions but I could not implemented.
1
0
1.4k
Dec ’22