Search results for

“DeviceActivityReport”

127 results found

Post

Replies

Boosts

Views

Activity

Reply to Detecting Termination and Re-establishing Connection with DeviceActivityReport App Extension
Hey ! We encounter similar issues in the past, and didn't find any proper documented way to monitor the DeviceActivityReport extension state, or to prevent crashes from happening. You can provide a way for your user to reload the view himself in case of crash using regular SwiftUI methods. We've opened several radars, some of them more than a year ago, without any answer at the moment. I would suggest you to do the same, the more they are, the more likely they'll fix it ! Regards !
Topic: App & System Services SubTopic: General Tags:
Sep ’23
Reply to Detecting Termination and Re-establishing Connection with DeviceActivityReport App Extension
I've encountered the same issue, but based on my testing, it's not because of the 100MB limit. It's actually because iOS, when it's running low on resources, prioritizes cleaning up processes with lower priority. DeviceActivityReport falls into that category. You can try playing games or watching videos, and it's almost a guaranteed way to reproduce the issue. However, successfully reloading it is indeed quite challenging. I wonder how other apps handle this?
Topic: App & System Services SubTopic: General Tags:
Sep ’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
FamilyControls entitlement approved, but Provisioning Profile doesn't include deviceActivity & deviceActivityReporting
Hi - appreciate your help in advance! Building a simple habit tracking app. I got approval for FamilyControls distribution. After creating a new provisioning profile with those capabilities enabled, when I try and build in xcode (16.4) using that Profile I get an error stating: Provisioning profile CreateMoreFamilyControlsv2 doesn't include the com.apple.developer.deviceactivity and com.apple.developer.deviceactivity.reporting entitlements I've confirmed bundle identifier matches, Team etc Similarly when i do automatic signing see 3rd screenshot. Not sure what to do at this point, I've heard deviceActivity is automatically applied when family controls is approved but still running into this issue.
2
0
290
Sep ’25
Reply to Is Screen Time trapped inside DeviceActivityReport on purpose?
Earlier I wrote: [quote='878084022, DTS Engineer, /thread/817516?answerId=878084022#878084022'] it certainly looks like this includes Device Activity report extensions. [/quote] I was digging into this some more in a different context, and as part of that I found a clear explanation of how this works. See the doc comments for DeviceActivityReport. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic: Privacy & Security SubTopic: General Tags:
Mar ’26
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 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
Reply to Screen Time API - Get user total screen time
[quote='797162021, Roshan_Owaves, /thread/797162, /profile/Roshan_Owaves'] If not, is it expected that this data is only available in the Settings app and not exposed to developers? [/quote] Unfortunately, the only way to access this data is within a sandboxed DeviceActivityReport Extension, as you have correctly stated. So there’s no way for you to extract the data and use it for something else. Seems like Apple is keeping that functionality for themselves. You could try filing a feedback request via https://feedbackassistant.apple.com to make sure they’ll consider adding this.
Topic: App & System Services SubTopic: General Tags:
Aug ’25
Reply to Can We Display Screen Time Data in WidgetKit?
[quote='792604021, AleksandrChernyshev, /thread/792604, /profile/AleksandrChernyshev'] Home Screen widget for iOS that displays device usage statistics [/quote] This is not possible unfortunately. The DeviceActivityReport does not work in widgets. But it would be a cool feature for sure! Feedback Requests: FB18927789 FB16409127 I would highly encourage you to file a feedback request on this as well! See also this thread, same issue has already been discussed in 2023 and seems like Apple did not consider the enhancement requests from back then: https://forums.developer.apple.com/forums/thread/724041
Jul ’25
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 Is Screen Time trapped inside DeviceActivityReport on purpose?
[quote='817516021, Melwin, /thread/817516, /profile/Melwin'] Is Screen Time trapped inside DeviceActivityReport on purpose? [/quote] Yes. Some app extensions handle extremely sensitive data that shouldn’t leave the device. The system runs such appexen in a read-only sandbox, so that the appex can’t export that sensitive data to other code with a less restrictive sandbox. I’m more familiar with this idea in the context of Network Extension content filters, where the docs clearly explain this concept. However, I’ve seen the same technology used for numerous other appex types, and it certainly looks like this includes Device Activity report extensions. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic: Privacy & Security SubTopic: General Tags:
Mar ’26
Reply to DeviceActivityReport fails to display SceneView
Hello, thanks for your response. Since I first posted, I discovered I can get the scene to render within the iPhone simulator on my mac, but not on my physical iPhone. However, the scene renders fine on my phone when it is in the main app and not within the DeviceActivityReportExtension, so I don't think it's a hardware issue with my phone. Here is my DeviceActivityReportExtension containing my DeviceActivityReportScene. import DeviceActivity import SwiftUI @main struct TestActivityReport: DeviceActivityReportExtension { var body: some DeviceActivityReportScene { TotalActivityReport { totalActivity in TotalActivityView(totalActivity: totalActivity) } } } Here is how I am calling the extension from the main app struct ContentView: View let context = DeviceActivityReport.Context.totalActivity let now = Date() let oneWeekAgo = Calendar.current.date(byAdding: .day, value: -7, to: Date())! var body: some View { DeviceActivityReport(context, filter: DeviceActivityFilter(segment: .daily(during: DateInterval
Topic: App & System Services SubTopic: General Tags:
Jan ’25
Reply to DeviceActivityReport extension not discovered at runtime (ClientError Code=2)
Hi Thanks a lot for your previous hint — it helped me fix the bundle setup. I now have the following confirmed: The report extension is correctly embedded under: Work4Fun.app/Extensions/UsageReportExtension.appex Info.plist uses: EXAppExtensionAttributes → EXExtensionPointIdentifier = com.apple.deviceactivityui.report-extension Entitlements include: com.apple.developer.family-controls com.apple.developer.family-controls.app-and-website-usage App Group The compiled binary clearly contains my code (UsageReportExtension.init, makeConfiguration, etc.) However, at runtime: DeviceActivityReport is instantiated (I see my view appear) System logs show: Plugin query method called But the extension is never actually executed: no init no makeConfiguration no output file written in App Group I also tried: deleting the app rebooting the device reinstalling from Xcode re-authorizing Screen Time → same result So it looks like: → iOS resolves the extension, but does not launch it Have you seen this behavior before?
Topic: App & System Services SubTopic: General Tags:
Apr ’26
Reply to DeviceActivityReport not showing report data to main app
I am getting the exact same error! Not sure how I am failing to grant permission in my main app as well. I even checked with print statements in my code to see if the Screen Time Authorization status was approved like this - print(Screen Time Authorization Status (authorizationStatus)) This was the full error when I attempted to run DeviceActivityReport(appsConext, filter: filter) -- LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 process may not map database UserInfo={NSDebugDescription=process may not map database, _LSLine=68, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler} Attempt to map database failed: permission was denied. This attempt will not be retried. Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-54 process may not map database UserInfo={NSDebugDescription=process may not map database, _LSLine=68, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler}
Topic: App & System Services SubTopic: General Tags:
Dec ’24
How to force update data from child phone ? FamilyControls / Screen Time Api / DeviceActivity
The data displayed about a child’s apps can be outdated (DeviceActivityReport), leading to misinformation for the user. When I access the “Screen Time” section (for child in the parent device) in the iPhone settings, I see there is an update functionality to force load the actual data. I have tried various workarounds, such as attempting to force an update on the child’s device to call DeviceActivityReport and opening system settings, but none of these have been successful :( How can I implement something similar? Is there a way to force update this data ?
0
0
549
Nov ’24
Reply to Detecting Termination and Re-establishing Connection with DeviceActivityReport App Extension
Hey ! We encounter similar issues in the past, and didn't find any proper documented way to monitor the DeviceActivityReport extension state, or to prevent crashes from happening. You can provide a way for your user to reload the view himself in case of crash using regular SwiftUI methods. We've opened several radars, some of them more than a year ago, without any answer at the moment. I would suggest you to do the same, the more they are, the more likely they'll fix it ! Regards !
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’23
Reply to Detecting Termination and Re-establishing Connection with DeviceActivityReport App Extension
I've encountered the same issue, but based on my testing, it's not because of the 100MB limit. It's actually because iOS, when it's running low on resources, prioritizes cleaning up processes with lower priority. DeviceActivityReport falls into that category. You can try playing games or watching videos, and it's almost a guaranteed way to reproduce the issue. However, successfully reloading it is indeed quite challenging. I wonder how other apps handle this?
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’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:
Replies
Boosts
Views
Activity
Mar ’23
FamilyControls entitlement approved, but Provisioning Profile doesn't include deviceActivity & deviceActivityReporting
Hi - appreciate your help in advance! Building a simple habit tracking app. I got approval for FamilyControls distribution. After creating a new provisioning profile with those capabilities enabled, when I try and build in xcode (16.4) using that Profile I get an error stating: Provisioning profile CreateMoreFamilyControlsv2 doesn't include the com.apple.developer.deviceactivity and com.apple.developer.deviceactivity.reporting entitlements I've confirmed bundle identifier matches, Team etc Similarly when i do automatic signing see 3rd screenshot. Not sure what to do at this point, I've heard deviceActivity is automatically applied when family controls is approved but still running into this issue.
Replies
2
Boosts
0
Views
290
Activity
Sep ’25
Reply to Is Screen Time trapped inside DeviceActivityReport on purpose?
Earlier I wrote: [quote='878084022, DTS Engineer, /thread/817516?answerId=878084022#878084022'] it certainly looks like this includes Device Activity report extensions. [/quote] I was digging into this some more in a different context, and as part of that I found a clear explanation of how this works. See the doc comments for DeviceActivityReport. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic: Privacy & Security SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’26
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:
Replies
Boosts
Views
Activity
Jan ’23
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:
Replies
Boosts
Views
Activity
Dec ’22
Reply to Screen Time API - Get user total screen time
[quote='797162021, Roshan_Owaves, /thread/797162, /profile/Roshan_Owaves'] If not, is it expected that this data is only available in the Settings app and not exposed to developers? [/quote] Unfortunately, the only way to access this data is within a sandboxed DeviceActivityReport Extension, as you have correctly stated. So there’s no way for you to extract the data and use it for something else. Seems like Apple is keeping that functionality for themselves. You could try filing a feedback request via https://feedbackassistant.apple.com to make sure they’ll consider adding this.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’25
Reply to Can We Display Screen Time Data in WidgetKit?
[quote='792604021, AleksandrChernyshev, /thread/792604, /profile/AleksandrChernyshev'] Home Screen widget for iOS that displays device usage statistics [/quote] This is not possible unfortunately. The DeviceActivityReport does not work in widgets. But it would be a cool feature for sure! Feedback Requests: FB18927789 FB16409127 I would highly encourage you to file a feedback request on this as well! See also this thread, same issue has already been discussed in 2023 and seems like Apple did not consider the enhancement requests from back then: https://forums.developer.apple.com/forums/thread/724041
Replies
Boosts
Views
Activity
Jul ’25
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:
Replies
Boosts
Views
Activity
Dec ’22
Reply to Is Screen Time trapped inside DeviceActivityReport on purpose?
[quote='817516021, Melwin, /thread/817516, /profile/Melwin'] Is Screen Time trapped inside DeviceActivityReport on purpose? [/quote] Yes. Some app extensions handle extremely sensitive data that shouldn’t leave the device. The system runs such appexen in a read-only sandbox, so that the appex can’t export that sensitive data to other code with a less restrictive sandbox. I’m more familiar with this idea in the context of Network Extension content filters, where the docs clearly explain this concept. However, I’ve seen the same technology used for numerous other appex types, and it certainly looks like this includes Device Activity report extensions. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic: Privacy & Security SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’26
Reply to DeviceActivityReport fails to display SceneView
Hello, thanks for your response. Since I first posted, I discovered I can get the scene to render within the iPhone simulator on my mac, but not on my physical iPhone. However, the scene renders fine on my phone when it is in the main app and not within the DeviceActivityReportExtension, so I don't think it's a hardware issue with my phone. Here is my DeviceActivityReportExtension containing my DeviceActivityReportScene. import DeviceActivity import SwiftUI @main struct TestActivityReport: DeviceActivityReportExtension { var body: some DeviceActivityReportScene { TotalActivityReport { totalActivity in TotalActivityView(totalActivity: totalActivity) } } } Here is how I am calling the extension from the main app struct ContentView: View let context = DeviceActivityReport.Context.totalActivity let now = Date() let oneWeekAgo = Calendar.current.date(byAdding: .day, value: -7, to: Date())! var body: some View { DeviceActivityReport(context, filter: DeviceActivityFilter(segment: .daily(during: DateInterval
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jan ’25
Reply to DeviceActivityReport extension not discovered at runtime (ClientError Code=2)
Hi Thanks a lot for your previous hint — it helped me fix the bundle setup. I now have the following confirmed: The report extension is correctly embedded under: Work4Fun.app/Extensions/UsageReportExtension.appex Info.plist uses: EXAppExtensionAttributes → EXExtensionPointIdentifier = com.apple.deviceactivityui.report-extension Entitlements include: com.apple.developer.family-controls com.apple.developer.family-controls.app-and-website-usage App Group The compiled binary clearly contains my code (UsageReportExtension.init, makeConfiguration, etc.) However, at runtime: DeviceActivityReport is instantiated (I see my view appear) System logs show: Plugin query method called But the extension is never actually executed: no init no makeConfiguration no output file written in App Group I also tried: deleting the app rebooting the device reinstalling from Xcode re-authorizing Screen Time → same result So it looks like: → iOS resolves the extension, but does not launch it Have you seen this behavior before?
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Apr ’26
Reply to DeviceActivityReport not showing report data to main app
I am getting the exact same error! Not sure how I am failing to grant permission in my main app as well. I even checked with print statements in my code to see if the Screen Time Authorization status was approved like this - print(Screen Time Authorization Status (authorizationStatus)) This was the full error when I attempted to run DeviceActivityReport(appsConext, filter: filter) -- LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 process may not map database UserInfo={NSDebugDescription=process may not map database, _LSLine=68, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler} Attempt to map database failed: permission was denied. This attempt will not be retried. Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-54 process may not map database UserInfo={NSDebugDescription=process may not map database, _LSLine=68, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler}
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’24
How to force update data from child phone ? FamilyControls / Screen Time Api / DeviceActivity
The data displayed about a child’s apps can be outdated (DeviceActivityReport), leading to misinformation for the user. When I access the “Screen Time” section (for child in the parent device) in the iPhone settings, I see there is an update functionality to force load the actual data. I have tried various workarounds, such as attempting to force an update on the child’s device to call DeviceActivityReport and opening system settings, but none of these have been successful :( How can I implement something similar? Is there a way to force update this data ?
Replies
0
Boosts
0
Views
549
Activity
Nov ’24