I want to display device activity reports for particular selected apps. for getting a daily basis app uses time. Now, what is happening? there are 10 apps selected from the family activity picker but some apps are displayed in the list. I need all 10 apps or more that I will choose from the family activity picker. The bellow code is used for fetching reports. var body: some View { VStack { DeviceActivityReport(context, filter: filter) } } bellow code is used for the filter @State public var filter = DeviceActivityFilter() init(selectedApps: Set, selectedCategories: Set, selectedWebDomains: Set) { self.selectedApps = selectedApps self.selectedCategories = selectedCategories self.selectedWebDomains = selectedWebDomains self.filter = DeviceActivityFilter( segment: .daily( during: Calendar.current.dateInterval( of: .weekOfYear, for: .now )! ), users: .all, devices: .init([.iPhone]), applications: selectedApps, categories: selectedCategories, webDomains: selectedWebDomains ) } You can see we selected 3 ap
Search results for
DeviceActivityReport
118 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I want to display device activity reports for particular selected apps. for getting a daily basis app uses time. Now, what is happening? there are 10 apps selected from the family activity picker but some apps are displayed in the list. I need all 10 apps or more that I will choose from the family activity picker. The bellow code is used for fetching reports. var body: some View { VStack { DeviceActivityReport(context, filter: filter) } } bellow code is used for the filter @State public var filter = DeviceActivityFilter() init(selectedApps: Set, selectedCategories: Set, selectedWebDomains: Set) { self.selectedApps = selectedApps self.selectedCategories = selectedCategories self.selectedWebDomains = selectedWebDomains self.filter = DeviceActivityFilter( segment: .daily( during: Calendar.current.dateInterval( of: .weekOfYear, for: .now )! ), users: .all, devices: .init([.iPhone]), applications: selectedApps, categories: selectedCategories, webDomains: selectedWebDomains ) } You can see we selected 3 ap
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
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:
There is an inconsistent issue when views are rendered from the Device Activity Report Extension. This issue is noticeable only on release versions and it works fine in debug mode. Around 80% of the times, the Report Views return blank screen and this is only the case when a weekly/monthly filter is used. Although, it works as expected for daily report views. My questions are: How are all the Report Activity Views working fine in debug mode but not in release mode? How the daily activity filter works fine in the release mode but the weekly/monthly filters don't work? Is this because of a memory limit issue in the extension? As of now, I have the family-controls(distribution) entitlement only for the app and for the extensions I only have family-controls(development) entitlement. Do I need to request for family-controls(Distribution) entitlement even for the extensions? I have seen threads on the forum mentioning the blank screen issue associated with the DeviceActivityReport but haven't found a solut
Topic:
App & System Services
SubTopic:
General
Tags:
Extensions
Entitlements
Device Activity
Screen Time
I've been working with the Screen Time API for almost 6 months now. I found out it's completely unreliable, testing on iOS 17.4, the DeviceActivityReport is not showing, the DeviceActivityMonitor more often than not does not fire intervalDidStart. It's very frustrating. Has anyone found out a workaround? We all know there has to be something we're doing wrong, since apps like Opal and Jono does not present those types of issues. Let's please unite our forces and find a solution. How to use this API should not be a secret!
Topic:
App & System Services
SubTopic:
General
Tags:
Family Controls
Device Activity
Managed Settings
Screen Time
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:
Hi @caleb4hzglory, yh im having same issue as @JosephCa not being able to see anything from my content view when i add the DeviceActivityReport. Can you share with us some code snippet or idea how you get working on physical device please thank you
Topic:
Privacy & Security
SubTopic:
General
Tags:
@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:
Hi everyone ! Apple just announced that Xcode 15 will be mandatory to publish app updates starting April 2024 (https://developer.apple.com/ios/submit/) This is making this bug critical as we will have to drop iOS 16 if we want to update our apps containing DeviceActivityReport.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
@pravinu that's 100% impossible because Device Activity Report Extension is in the sandbox that can read data but can't write to any storage or make any network calls To protect the user’s privacy, your extension runs in a sandbox. This sandbox prevents your extension from making network requests or moving sensitive content outside the extension’s address space https://developer.apple.com/documentation/deviceactivity/deviceactivityreport
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
App with DeviceActivityReport extension either won't install on device or won't upload to TestFlight
We have integrated DeviceActivityReport to our Family Controll app. All capabilities are added. We built the app and tested it, but when we want to upload to TestFlight the following error happened (see attached image) When we are adding NSExtensionMainStoryboard or NSExtensionPrincipalClass the following error appears during installation process. DeviceReport.appex with id com.example.example.DeviceReport defines either an NSExtensionMainStoryboard or NSExtensionPrincipalClass key, which is not allowed for the extension point com.apple.deviceactivityui.report-extension
Same issues here. It seems there hasn't been a solution yet? Getting Failed to discover the client's extension: Error Domain=DeviceActivityReportService.ReportViewController.ClientError Code=2 (null) when just trying to render the view on my iOS 17 iPhone, and the DeviceActivityReport View is rendering.
Topic:
App & System Services
SubTopic:
General
Tags:
@_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:
Our app uses DeviceActivityReport to display the user’s screen time. The performance of DeviceActivityReport is often very poor. These issue occur commonly: Screen time is reported as 0 minutes DeviceActivityReport View appears completely blank The host app loses connection with the DeviceActivityReport altogether I have implemented several workarounds which only slightly improve the performance, to varying degrees depending on the device iOS: Inside the DeviceActivityReport code - retry fetching screen time data until it returns a non-zero result Implement a “refresh” button which reloads the DeviceActivityReport view from the host app However, due to the sandboxed nature of DeviceActivityReport, there is no way for the host application to tell if the DeviceActivityReport extension is experiencing these performance issues. It results in a really bad user experience. I am building the app with Xcode 14 due to another issue where DeviceActivityReport