Search results for

“DeviceActivityReport”

135 results found

Post

Replies

Boosts

Views

Activity

How to show icons apps when retrieving DeviceActivityReport
Actually, I'm developing a new app based on screen time API, so I implemented my report device extension like this 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: (ActivityReport) -> TotalActivityView func makeConfiguration(representing data: DeviceActivityResults) async -> ActivityReport { // Reformat the data into a configuration that can be used to create // the report's view. var res = var list: [AppDeviceActivity] = [] let totalActivityDuration = await data.flatMap { $0.activitySegments }.reduce(0, { $0 + $1.totalActivityDuration }) for await d in data { res += d.user.appleID!.debugDescription res += d.lastUpdatedDate.description for await a in d.activitySegments{ res += a.totalActivityDuration.formatted() for await c in a.categories { for await ap in c.applications { let appName = (ap.applicati
0
0
743
Jun ’24
DeviceActivityReport: visible per-app list updates, but aggregate total for same selection lags
Hi, I’m using FamilyControls + DeviceActivity. Users select apps/categories/web domains via FamilyActivitySelection. I need to show today’s total usage for that selected group only, not the device’s full Screen Time. Setup: A visible DeviceActivityReport shows today’s per-app list with a daily DeviceActivityFilter for the selected tokens. This visible list is usually accurate and updates quickly. A separate hidden DeviceActivityReport uses the same filter to compute an aggregate total by summing app.totalActivityDuration in makeConfiguration(representing:). The extension sends that total to the main app via notify_set_state + Darwin notification. DeviceActivityMonitor is only used as a fallback. Problem: The visible app list stays current, but the aggregate total for the same selected apps sometimes lags by several minutes or updates only after new selected-app usage occurs. Sometimes the total appears temporarily frozen while the app list still looks correct. Questions: Is a hidden DeviceActivityReport
0
0
104
6d
Reply to API Screen Time
You can use a DeviceActivityReport and build an extension that gets access to the totalActivityDuration for a daily activity segment. This time interval represents the total amount of time the device's screen was on.
Topic: App & System Services SubTopic: General Tags:
Nov ’22
DeviceActivityReport no longer works on iOS 16 with Xcode 15
Hello, we had working DeviceActivityReport in our app for months now. However when building with Xcode 15 (previously betas, now the GM), the activity reports no longer displays anything on iOS 16 devices. If we run it with Xcode 14, it works. But with Xcode 15 builds, the device activity report only works on iOS 17 devices :( I am able to see some somewhat generic errors in the Console.app when opening screen that contains the report. -[_EXServiceClient launchWithConfiguration:error:]_block_invoke failed with error: Error Domain=com.apple.extensionKit.errorDomain Code=2 UserInfo={NSUnderlyingError=0x280b9b600 {Error Domain=RBSRequestErrorDomain Code=5 UserInfo={NSLocalizedFailureReason=}}} Failed to create extensionProcess for extension '' error: Error Domain=com.apple.extensionKit.errorDomain Code=2 UserInfo={NSUnderlyingError=0x280b9b600 {Error Domain=RBSRequestErrorDomain Code=5 UserInfo={NSLocalizedFailureReason=}}}. Failed to make extensionProcess with error: Error Domain=com.apple.extensionKit
3
0
1.9k
Sep ’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.3k
Mar ’23
DeviceActivityReport Extension not working on iOS 26.4 — Extension process never launches
Device: iPhone 15 Pro Max, iOS 26.4 Xcode: Latest version, development signing with Automatically manage signing Team: Registered Apple Developer Program (Organization) Problem DeviceActivityReport SwiftUI view renders completely blank. The Report Extension's makeConfiguration(representing:) is never called (confirmed via App Group counter that stays at 0). The DeviceActivityMonitorExtension callbacks (intervalDidStart, eventDidReachThreshold) also never fire. What works AuthorizationCenter.shared.requestAuthorization(for: .individual) → .approved DeviceActivityCenter().startMonitoring() → registers schedules successfully, center.activities returns them ManagedSettingsStore.shield.applications → blocks apps correctly from the main app process Screen Time is enabled and actively collecting data (Settings > Screen Time shows per-app usage: Clash Royale 2h 35m, etc.) App Group UserDefaults(suiteName:) read/write works from the main app What doesn't work DeviceActivityReportExtension.makeConfiguration
2
0
525
Apr ’26
DeviceActivityReport: is host-owned scrolling over an embedded report possible, and can the report present full-screen modals?
I’m building a rich Home surface around a DeviceActivityReport embedded in my host app, and I’ve hit a set of boundaries that I’d like to confirm as intended behavior rather than something I’m doing wrong. All results below are from physical devices running iOS 18 and iOS 26, since Screen Time data is not available in Simulator. What I’m trying to build I want a single scrolling page where: The host app owns some chrome, including a date picker, refresh button, and settings button. The embedded DeviceActivityReport renders the Screen Time data, including totals, a per-hour chart, and per-app usage. The host chrome can react to the report scrolling. Taps inside the report can open a full-screen sheet. Findings so far 1. Report → host App Group writes do not reach the host A UserDefaults(suiteName:) write, or a file written to the App Group container, from inside the report extension returns success. However, the host app reads nil for those keys, including for a plain string marker unrelated
0
0
91
4w
How to show icons apps when retrieving DeviceActivityReport
Actually, I'm developing a new app based on screen time API, so I implemented my report device extension like this 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: (ActivityReport) -> TotalActivityView func makeConfiguration(representing data: DeviceActivityResults) async -> ActivityReport { // Reformat the data into a configuration that can be used to create // the report's view. var res = var list: [AppDeviceActivity] = [] let totalActivityDuration = await data.flatMap { $0.activitySegments }.reduce(0, { $0 + $1.totalActivityDuration }) for await d in data { res += d.user.appleID!.debugDescription res += d.lastUpdatedDate.description for await a in d.activitySegments{ res += a.totalActivityDuration.formatted() for await c in a.categories { for await ap in c.applications { let appName = (ap.applicati
Replies
0
Boosts
0
Views
743
Activity
Jun ’24
DeviceActivityReport: visible per-app list updates, but aggregate total for same selection lags
Hi, I’m using FamilyControls + DeviceActivity. Users select apps/categories/web domains via FamilyActivitySelection. I need to show today’s total usage for that selected group only, not the device’s full Screen Time. Setup: A visible DeviceActivityReport shows today’s per-app list with a daily DeviceActivityFilter for the selected tokens. This visible list is usually accurate and updates quickly. A separate hidden DeviceActivityReport uses the same filter to compute an aggregate total by summing app.totalActivityDuration in makeConfiguration(representing:). The extension sends that total to the main app via notify_set_state + Darwin notification. DeviceActivityMonitor is only used as a fallback. Problem: The visible app list stays current, but the aggregate total for the same selected apps sometimes lags by several minutes or updates only after new selected-app usage occurs. Sometimes the total appears temporarily frozen while the app list still looks correct. Questions: Is a hidden DeviceActivityReport
Replies
0
Boosts
0
Views
104
Activity
6d
Reply to Please help make DeviceActivityReport reliably show up
@_lilpit , @thomas_maht - have Opal and Jomo implemented any special tricks / hacks to improve the performance of DeviceActivityReport - your apps display screen time especially well on my device.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’23
Reply to API Screen Time
You can use a DeviceActivityReport and build an extension that gets access to the totalActivityDuration for a daily activity segment. This time interval represents the total amount of time the device's screen was on.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Nov ’22
Reply to Device Activity Report View Size and Background
@caleb4hzglory How do you able to get data from the DeviceActivityReport Extension? I always have empty content view. Can you share to me your code snippet how you do it? Thanks
Topic: Privacy & Security SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’24
DeviceActivityReport no longer works on iOS 16 with Xcode 15
Hello, we had working DeviceActivityReport in our app for months now. However when building with Xcode 15 (previously betas, now the GM), the activity reports no longer displays anything on iOS 16 devices. If we run it with Xcode 14, it works. But with Xcode 15 builds, the device activity report only works on iOS 17 devices :( I am able to see some somewhat generic errors in the Console.app when opening screen that contains the report. -[_EXServiceClient launchWithConfiguration:error:]_block_invoke failed with error: Error Domain=com.apple.extensionKit.errorDomain Code=2 UserInfo={NSUnderlyingError=0x280b9b600 {Error Domain=RBSRequestErrorDomain Code=5 UserInfo={NSLocalizedFailureReason=}}} Failed to create extensionProcess for extension '' error: Error Domain=com.apple.extensionKit.errorDomain Code=2 UserInfo={NSUnderlyingError=0x280b9b600 {Error Domain=RBSRequestErrorDomain Code=5 UserInfo={NSLocalizedFailureReason=}}}. Failed to make extensionProcess with error: Error Domain=com.apple.extensionKit
Replies
3
Boosts
0
Views
1.9k
Activity
Sep ’23
Reply to Device Activity Report only for Selected Apps
DeviceActivityReport will give you data for all of the installed apps on your phone (devices: .init([.iPhone])). Then you have to filter down that data based on your restricted apps which you have selected through FamilyActivitySelection().
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jan ’25
Reply to Uploading app with Family Controls to TestFlight?
Alongside requesting the distribution entitlement for the app, you should send another request for each new target (extension) that uses family-control capability, like DeviceActivity, DeviceActivityReport
Topic: Code Signing SubTopic: Entitlements Tags:
Replies
Boosts
Views
Activity
Apr ’24
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!
Replies
1
Boosts
0
Views
1.3k
Activity
Mar ’23
Reply to Grabbing the current remaining threshold minutes from a DeviceActivity schedule?
It appears DeviceActivityReport is a view. Is there a way to extract this information without a view? Is there a code example floating around somewhere? cc: @kmart
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to DeviceActivityReport Lag
I'm having the same issue. Has anyone found a way to resolve this? I've noticed that larger apps like Opal seem to get DeviceActivityReport to appear without issues.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’25
DeviceActivityReport Extension not working on iOS 26.4 — Extension process never launches
Device: iPhone 15 Pro Max, iOS 26.4 Xcode: Latest version, development signing with Automatically manage signing Team: Registered Apple Developer Program (Organization) Problem DeviceActivityReport SwiftUI view renders completely blank. The Report Extension's makeConfiguration(representing:) is never called (confirmed via App Group counter that stays at 0). The DeviceActivityMonitorExtension callbacks (intervalDidStart, eventDidReachThreshold) also never fire. What works AuthorizationCenter.shared.requestAuthorization(for: .individual) → .approved DeviceActivityCenter().startMonitoring() → registers schedules successfully, center.activities returns them ManagedSettingsStore.shield.applications → blocks apps correctly from the main app process Screen Time is enabled and actively collecting data (Settings > Screen Time shows per-app usage: Clash Royale 2h 35m, etc.) App Group UserDefaults(suiteName:) read/write works from the main app What doesn't work DeviceActivityReportExtension.makeConfiguration
Replies
2
Boosts
0
Views
525
Activity
Apr ’26
Reply to Transitions inside ScreenTime Report is not working if phone locked when app is opened.
Can you open a bug report for it ? we reported a lot of issues with DeviceActivityReport views not behaving like regular SwiftUI views, and this would complement those bug reports
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
3w
Reply to Recently used applications on guardian phone - FamilyControls, DeviceActivityReport
Partially answering my own question, yes, it is possible by just using DeviceActivityReport. But, can the tokens be used for example, to block those apps by the parent? The extension is sandboxed, but I'm pretty sure there is a way.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’25
DeviceActivityReport: is host-owned scrolling over an embedded report possible, and can the report present full-screen modals?
I’m building a rich Home surface around a DeviceActivityReport embedded in my host app, and I’ve hit a set of boundaries that I’d like to confirm as intended behavior rather than something I’m doing wrong. All results below are from physical devices running iOS 18 and iOS 26, since Screen Time data is not available in Simulator. What I’m trying to build I want a single scrolling page where: The host app owns some chrome, including a date picker, refresh button, and settings button. The embedded DeviceActivityReport renders the Screen Time data, including totals, a per-hour chart, and per-app usage. The host chrome can react to the report scrolling. Taps inside the report can open a full-screen sheet. Findings so far 1. Report → host App Group writes do not reach the host A UserDefaults(suiteName:) write, or a file written to the App Group container, from inside the report extension returns success. However, the host app reads nil for those keys, including for a plain string marker unrelated
Replies
0
Boosts
0
Views
91
Activity
4w