Search results for

“DeviceActivityReport”

127 results found

Post

Replies

Boosts

Views

Activity

Cannot get DeviceActivityReport to work
I am unable to make any progress regarding DeviceActivityReport. The session from WWDC 2022 covers it very briefly. What I (hopefully correctly) understood is that we need to create an extension of type Activity report and inside it implement the body which is DeviceActivityReportScene that will display the charts and what not. And then in the app, we need to use DeviceActivityReport with SwiftUI to show the report which will be run in sandbox from the extension. But I cannot get anything to show up on the screen. Even when my extension view is just a static text to verify something gets displayed. I am trying to create the device activity report without any filter which should give me all activity data per the docs. This is shown in the Xcode console for the view that uses DeviceActivityReport. 2022-06-17 18:08:47.219785+0200 DeviceActivityTest[9613:954204] [default] LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 process may not map
17
0
5.8k
Jun ’22
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
DeviceActivityReport failing to load "Code = 2"
Hi! For some reason my DeviceActivityReport sometimes fails to load. I've tried setting up a very simple mock views and displaying a report with a simple Hello world but even that won't work. It prints the following error message in the terminal but doesn't show anything else or any context as to what has gone wrong. Failed to update the client's configuration: Error Domain=DeviceActivityReportService.ReportViewController.ClientError Code=2 (null) It seems like the makeConfiguration method for the report isn't even being invoked. That may though just be an issue with printing messages in the extension. Any help on what could be the issue, or even just a message that you're being the same thing would be greatly appreciated!
0
0
183
Oct ’25
DeviceActivityReport extension not discovered at runtime (ClientError Code=2)
Hi I am trying to implement a minimal DeviceActivityReport extension. Setup: iOS app with FamilyControls authorization (status = approved) DeviceActivityReport displayed in SwiftUI Report extension embedded in PlugIns Correct NSExtensionPointIdentifier: com.apple.deviceactivityui.report-extension No NSExtensionPrincipalClass or storyboard Entitlements: com.apple.developer.family-controls com.apple.developer.family-controls.app-and-website-usage The app installs and runs correctly. Authorization is granted. However, the extension is never loaded: No logs from the extension (init/body/makeConfiguration never called) Console shows: Failed to discover the client's extension: DeviceActivityReportService... ClientError Code=2 Environment: Xcode 16.2 iOS device running iOS 18.x (latest available) The .appex is correctly embedded and signed. Question: Is there a known issue with DeviceActivityReport extensions not being discovered at runtime with this setup? Is additional configuration requ
2
0
306
Apr ’26
Detecting Termination and Re-establishing Connection with DeviceActivityReport App Extension
Hello, I have an iOS app using the DeviceActivityReport app extension. Occasionally, the extension gets terminated (likely due to reaching memory limit**), which in turn disrupts the connection with the main app. How can the main app detect when the DeviceActivityReport extension has been terminated due to memory constraints, and what's the best way to re-establish the connection afterward? Thanks in advance for your insights and suggestions! ** I'm also unsure why the extension should be reaching its memory limit. When profiling the extension in XCode, it never reaches above 15MB, and I know the limit is 100MB. It's not doing anything out of the ordinary - and I've seen very similar complaints about DeviceActivityReport terminating on these forums. Any thoughts on how to prevent termination in the first place would also be super helpful!
3
0
1.4k
Sep ’23
DeviceActivityReport view fails to render until it's repeatedly added to the view hierarchy
The DeviceActivityReport view does not render immediately when added to the view hierarchy. Instead, it requires repeated navigation to the screen hosting the DeviceActivityReport view for it to appear. Furthermore, there is no programmatic way to determine whether the view is being rendered for the user, leading to an inconsistent and often poor user experience. I've created a sample project that demonstrates the issue.
2
0
541
Feb ’25
DeviceActivityReport - filtering applications for makeConfiguration
I am trying to filter my DeviceActivityReport to only show activity for the specific app tokens I pass in. Right now, it shows activity for all apps. Is there something else I need to do in makeConfiguration so that it only filters the application tokens that I'm filtering by? filter = DeviceActivityFilter(segment: .hourly(during: dateInterval), applications: task.selection.applicationTokens) struct TotalActivityReport: DeviceActivityReportScene { // Define which context your scene will represent. let context: DeviceActivityReport.Context = .totalActivity // Define the custom configuration and the resulting view for this report. let content: (String) -> TotalActivityView func makeConfiguration(representing data: DeviceActivityResults) async -> String { // Reformat the data into a configuration that can be used to create // the report's view. let formatter = DateComponentsFormatter() formatter.allowedUnits = [.minute, .second] formatter.unitsStyle = .abbreviated formatter.zeroFormattingBehavior
1
0
1.2k
Aug ’23
Monitoring Connection Status to a DeviceActivityReport App Extension
Hello, I've been working with an app that leverages a DeviceActivityReport app extension. I want to ensure that the main app can gracefully handle scenarios where the connection to the app extension might get terminated unexpectedly. Can anyone guide me on how to detect from the main app when the connection to the app extension gets terminated? I believe being able to detect this would allow for better error handling and potentially reduce instances where the UI appears blank due to a lost connection. Thank you for any insights or advice on this topic.
1
0
738
Sep ’23
Is Screen Time trapped inside DeviceActivityReport on purpose?
I can see the user’s real daily Screen Time perfectly inside a DeviceActivityReport extension on a physical device. It’s right there. But the moment I try to use that exact total inside my main app (for today’s log and a leaderboard), it dosnt work. I’ve tried, App Groups, Shared UserDefaults, Writing to a shared container file, CFPreferences Nothing makes it across. The report displays fine, but the containing app never receives the total. If this is sandboxed by design, I’d love confirmation. Thanks a lot
2
0
618
Mar ’26
DeviceActivityReport disappears when app comes back from background
Hello, I am trying to display basic screen time data on my main screen. On the initial load of the screen, the DeviceActivityReport renders correctly and visible, but after being in the background and coming back to the app, the whole view is just blank. I don't think I'm doing anything special. Is this a known bug? @main struct MyActivityReportExtension: DeviceActivityReportExtension { var body: some DeviceActivityReportScene { // Create a report for each DeviceActivityReport.Context that your app supports. TotalActivityReport { totalActivity in TotalActivityView(totalActivity: totalActivity) } // Add more reports here... } } 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(Total Activity) } struct TotalActivityReport: DeviceActivityReportScene { // Define which context your
1
0
381
Aug ’25
How to show Application Icons within usage report - DeviceActivityReport
I am able to show Device usage in a pie chart / custom view by using DeviceActivityReport extension. DeviceActivityReportScene, DeviceActivityResults every thing is working as expected. I can get application identifier and names from DeviceActivityData but wondering how I can show/get the Application ICON for each app while showing its usage. Apple in its presentation show the custom view that is showing Application icons. I have attached the screen show and also highlighted the App icon section.
1
0
3.5k
Oct ’22
DeviceActivityReport Formatting
Hello everyone, I'm currently developing an app that requires Device activity report to be displayed at the click of a button. I'm having an issue where when the button is clicked and the Device activity report is displayed it pushes all other elements away from it. Is this a feature and do I need to configure this specifically with a ZStack? Or am I doing something wrong on my end? Thanks!
0
0
515
Oct ’23
Unable to Use DeviceActivityReport to Show Screen Time in App
Hi team. I am working on an app that uses the Screen Time API. I got access to the family controls (distribution) capability through the request process for my main app. I added a DeviceActivityReport extension in XCode, but haven't been able to get the extension to show up on the screen. I noticed that the extension only has the development version of the family controls capability available. Is this the source of my errors? I was able to get the screen time displayed in a test app I built where both the main app and extension used the development version of the capability, which led me to believe that discrepancy could be the issue. Let me know if there is anything I can provide to help in the debugging process. I didn't send a minimal example in this request due to the fact that I would have to remove most of my functionality to create a minimal example (since the signing is only for my main app), but I can do that if needed. Thanks! I looked through the logs in the console for the phone (I'm test
5
0
448
Jan ’25
Cannot get DeviceActivityReport to work
I am unable to make any progress regarding DeviceActivityReport. The session from WWDC 2022 covers it very briefly. What I (hopefully correctly) understood is that we need to create an extension of type Activity report and inside it implement the body which is DeviceActivityReportScene that will display the charts and what not. And then in the app, we need to use DeviceActivityReport with SwiftUI to show the report which will be run in sandbox from the extension. But I cannot get anything to show up on the screen. Even when my extension view is just a static text to verify something gets displayed. I am trying to create the device activity report without any filter which should give me all activity data per the docs. This is shown in the Xcode console for the view that uses DeviceActivityReport. 2022-06-17 18:08:47.219785+0200 DeviceActivityTest[9613:954204] [default] LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 process may not map
Replies
17
Boosts
0
Views
5.8k
Activity
Jun ’22
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
Replies
2
Boosts
0
Views
2.1k
Activity
Jan ’23
DeviceActivityReport failing to load "Code = 2"
Hi! For some reason my DeviceActivityReport sometimes fails to load. I've tried setting up a very simple mock views and displaying a report with a simple Hello world but even that won't work. It prints the following error message in the terminal but doesn't show anything else or any context as to what has gone wrong. Failed to update the client's configuration: Error Domain=DeviceActivityReportService.ReportViewController.ClientError Code=2 (null) It seems like the makeConfiguration method for the report isn't even being invoked. That may though just be an issue with printing messages in the extension. Any help on what could be the issue, or even just a message that you're being the same thing would be greatly appreciated!
Replies
0
Boosts
0
Views
183
Activity
Oct ’25
DeviceActivityReport extension not discovered at runtime (ClientError Code=2)
Hi I am trying to implement a minimal DeviceActivityReport extension. Setup: iOS app with FamilyControls authorization (status = approved) DeviceActivityReport displayed in SwiftUI Report extension embedded in PlugIns Correct NSExtensionPointIdentifier: com.apple.deviceactivityui.report-extension No NSExtensionPrincipalClass or storyboard Entitlements: com.apple.developer.family-controls com.apple.developer.family-controls.app-and-website-usage The app installs and runs correctly. Authorization is granted. However, the extension is never loaded: No logs from the extension (init/body/makeConfiguration never called) Console shows: Failed to discover the client's extension: DeviceActivityReportService... ClientError Code=2 Environment: Xcode 16.2 iOS device running iOS 18.x (latest available) The .appex is correctly embedded and signed. Question: Is there a known issue with DeviceActivityReport extensions not being discovered at runtime with this setup? Is additional configuration requ
Replies
2
Boosts
0
Views
306
Activity
Apr ’26
Detecting Termination and Re-establishing Connection with DeviceActivityReport App Extension
Hello, I have an iOS app using the DeviceActivityReport app extension. Occasionally, the extension gets terminated (likely due to reaching memory limit**), which in turn disrupts the connection with the main app. How can the main app detect when the DeviceActivityReport extension has been terminated due to memory constraints, and what's the best way to re-establish the connection afterward? Thanks in advance for your insights and suggestions! ** I'm also unsure why the extension should be reaching its memory limit. When profiling the extension in XCode, it never reaches above 15MB, and I know the limit is 100MB. It's not doing anything out of the ordinary - and I've seen very similar complaints about DeviceActivityReport terminating on these forums. Any thoughts on how to prevent termination in the first place would also be super helpful!
Replies
3
Boosts
0
Views
1.4k
Activity
Sep ’23
DeviceActivityReport view fails to render until it's repeatedly added to the view hierarchy
The DeviceActivityReport view does not render immediately when added to the view hierarchy. Instead, it requires repeated navigation to the screen hosting the DeviceActivityReport view for it to appear. Furthermore, there is no programmatic way to determine whether the view is being rendered for the user, leading to an inconsistent and often poor user experience. I've created a sample project that demonstrates the issue.
Replies
2
Boosts
0
Views
541
Activity
Feb ’25
DeviceActivityReport not showing report data to main app
I am getting this error when I try to show device activity report view by this DeviceActivityReport(appsContext, filter: filter) Attempt to map database failed: permission was denied. This attempt will not be retried. I have taken access by this way. AuthorizationCenter.shared.requestAuthorization(for: .individual)
Replies
3
Boosts
0
Views
1.1k
Activity
Dec ’24
DeviceActivityReport - filtering applications for makeConfiguration
I am trying to filter my DeviceActivityReport to only show activity for the specific app tokens I pass in. Right now, it shows activity for all apps. Is there something else I need to do in makeConfiguration so that it only filters the application tokens that I'm filtering by? filter = DeviceActivityFilter(segment: .hourly(during: dateInterval), applications: task.selection.applicationTokens) struct TotalActivityReport: DeviceActivityReportScene { // Define which context your scene will represent. let context: DeviceActivityReport.Context = .totalActivity // Define the custom configuration and the resulting view for this report. let content: (String) -> TotalActivityView func makeConfiguration(representing data: DeviceActivityResults) async -> String { // Reformat the data into a configuration that can be used to create // the report's view. let formatter = DateComponentsFormatter() formatter.allowedUnits = [.minute, .second] formatter.unitsStyle = .abbreviated formatter.zeroFormattingBehavior
Replies
1
Boosts
0
Views
1.2k
Activity
Aug ’23
Monitoring Connection Status to a DeviceActivityReport App Extension
Hello, I've been working with an app that leverages a DeviceActivityReport app extension. I want to ensure that the main app can gracefully handle scenarios where the connection to the app extension might get terminated unexpectedly. Can anyone guide me on how to detect from the main app when the connection to the app extension gets terminated? I believe being able to detect this would allow for better error handling and potentially reduce instances where the UI appears blank due to a lost connection. Thank you for any insights or advice on this topic.
Replies
1
Boosts
0
Views
738
Activity
Sep ’23
Is Screen Time trapped inside DeviceActivityReport on purpose?
I can see the user’s real daily Screen Time perfectly inside a DeviceActivityReport extension on a physical device. It’s right there. But the moment I try to use that exact total inside my main app (for today’s log and a leaderboard), it dosnt work. I’ve tried, App Groups, Shared UserDefaults, Writing to a shared container file, CFPreferences Nothing makes it across. The report displays fine, but the containing app never receives the total. If this is sandboxed by design, I’d love confirmation. Thanks a lot
Replies
2
Boosts
0
Views
618
Activity
Mar ’26
Reply to Cannot get DeviceActivityReport to work
At first, I got the same issue and the name of my extension was DeviceActivityReport. Then, I removed the extension and created a new extension named DeviceActivityReport. As a result, the issue disappeared!
Topic: Privacy & Security SubTopic: General Tags:
Replies
Boosts
Views
Activity
May ’24
DeviceActivityReport disappears when app comes back from background
Hello, I am trying to display basic screen time data on my main screen. On the initial load of the screen, the DeviceActivityReport renders correctly and visible, but after being in the background and coming back to the app, the whole view is just blank. I don't think I'm doing anything special. Is this a known bug? @main struct MyActivityReportExtension: DeviceActivityReportExtension { var body: some DeviceActivityReportScene { // Create a report for each DeviceActivityReport.Context that your app supports. TotalActivityReport { totalActivity in TotalActivityView(totalActivity: totalActivity) } // Add more reports here... } } 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(Total Activity) } struct TotalActivityReport: DeviceActivityReportScene { // Define which context your
Replies
1
Boosts
0
Views
381
Activity
Aug ’25
How to show Application Icons within usage report - DeviceActivityReport
I am able to show Device usage in a pie chart / custom view by using DeviceActivityReport extension. DeviceActivityReportScene, DeviceActivityResults every thing is working as expected. I can get application identifier and names from DeviceActivityData but wondering how I can show/get the Application ICON for each app while showing its usage. Apple in its presentation show the custom view that is showing Application icons. I have attached the screen show and also highlighted the App icon section.
Replies
1
Boosts
0
Views
3.5k
Activity
Oct ’22
DeviceActivityReport Formatting
Hello everyone, I'm currently developing an app that requires Device activity report to be displayed at the click of a button. I'm having an issue where when the button is clicked and the Device activity report is displayed it pushes all other elements away from it. Is this a feature and do I need to configure this specifically with a ZStack? Or am I doing something wrong on my end? Thanks!
Replies
0
Boosts
0
Views
515
Activity
Oct ’23
Unable to Use DeviceActivityReport to Show Screen Time in App
Hi team. I am working on an app that uses the Screen Time API. I got access to the family controls (distribution) capability through the request process for my main app. I added a DeviceActivityReport extension in XCode, but haven't been able to get the extension to show up on the screen. I noticed that the extension only has the development version of the family controls capability available. Is this the source of my errors? I was able to get the screen time displayed in a test app I built where both the main app and extension used the development version of the capability, which led me to believe that discrepancy could be the issue. Let me know if there is anything I can provide to help in the debugging process. I didn't send a minimal example in this request due to the fact that I would have to remove most of my functionality to create a minimal example (since the signing is only for my main app), but I can do that if needed. Thanks! I looked through the logs in the console for the phone (I'm test
Replies
5
Boosts
0
Views
448
Activity
Jan ’25