Search results for

DeviceActivityReport

118 results found

Post

Replies

Boosts

Views

Activity

FamilySelectionPicker crashes due to internal memory limit
Disclaimer The setup of the FamilyControls capability, authorization etc. is all correct and properly working. The Issue Users complain that apps are not shown up on their parent device. Investigations For months we thought it's a syncing issue and eventually apps do show up. But another time (after already shown) they hide again. Insights We now found out, that the FamilyControlsAgent which is an internal process of iOS crashes due to exceeding their memory limit right before the picker should show up and then logs errors that it can't connect to helper process. Feedback Tickets: Including multiple sys-diagnose files, step by steps and more: FB11983206 FB11863463 FB11983304 Attention As more and more users get frustrated with it, we hope some Apple engineer sees this and helps bring attention to a fast bug fix. Maybe just increase internal memory limit threshold for such process via entitlement. FYI We also think this is the reason why the DeviceActivityReport can't show apps and crashes due this li
0
0
591
Feb ’23
FamilyControlsAgent crashes due to internal memory limit
Disclaimer The setup of the FamilyControls capability, authorization etc. is all correct and properly working. The Issue Users complain that apps are not shown up on their parent device. Investigations For months we thought it's a syncing issue and eventually apps do show up. But another time (after already shown) they hide again. Insights We now found out, that the FamilyControlsAgent which is an internal process of iOS crashes due to exceeding their memory limit right before the picker should show up and then logs errors that it can't connect to helper process. Feedback Tickets: Including multiple sys-diagnose files, step by steps and more: FB11983206 FB11863463 FB11983304 Attention As more and more users get frustrated with it, we hope some Apple engineer sees this and helps bring attention to a fast bug fix. Maybe just increase internal memory limit threshold for such process via entitlement. FYI We also think this is the reason why the DeviceActivityReport can't show apps and crashes due this li
0
0
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
Struggling to display DeviceActivityReport view in a widget
I want to add a widget to my app that will display the # of pickups the user has for the day. I have the DeviceActivityReport working in the main app but can't get it to display in the widget since it is not a supported view for widgets. Is there any workaround for getting this view to the widget? I tried converting the DeviceActivityReport view to a UI image thinking maybe that would be a way to use a widget approved view type but ImageRenderer seems to fail to render an image for the view (which is just a Text view). To summarize my questions: Is it possible to display a DeviceActivityReport in a widget? If so, what is the best practice? Is converting the DeviceActivityReport view into an image and displaying that in a widget an option? Here's my attempt to convert the DeviceActivityReport view into a UIImage: import SwiftUI import _DeviceActivity_SwiftUI struct PickupsDeviceActivityReport: View { @State private var context: DeviceActivityReport.Context = .totalA
3
0
1.4k
Jan ’23
Loading indicator until DeviceActivityReport renders?
There is frequently a delay of a few seconds before a DeviceActivityReport renders its view generated from the DeviceActivityReportExtension. It will also sometimes flash with zero data before hydrating with the real activity data (tested with extension code taken directly from XCode boilerplate) Is there a way to be notified when the DeviceActivityReport renders successfully or is still processing, i.e. so a loading indicator can be presented while the extension runs? Thanks!
3
0
2.2k
Jan ’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
Jan ’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
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 w
3
0
1.6k
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
Reply to DeviceActivity -> Screen time API. Accessing struct information
The DeviceActivityData.ActivitySegment type is provided only to Device Activity report extensions and cannot be instantiated by clients. You must implement a Device Activity report 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 will be rendered by your extension and the system will provide the chosen DeviceActivityReportScene with data via the scene's makeConfiguration function.
Topic: App & System Services SubTopic: General 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