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) Detailed errors: 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=72, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler} Attempt to map database failed: permission was denied. This attempt will not be retried.
Search results for
DeviceActivityReport
118 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
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)
Looking at Brainrot's UI, they display both Screen Time: 6h 31m and a calculated Health: 91/100 score with a Tap to Fix button. This suggests manual sync or a workaround. Specific Questions: Can DeviceActivityReport extensions communicate data back to the main app? (CloudKit, Notifications, Shared files?) Can extensions write to UserDefaults on physical devices? Do commercial apps rely on manual user sync? Is there an alternative API I'm overlooking? Do threshold-based approximations work reliably for daily tracking? I can extract exact minutes in the extension but can't export them to the main app due to sandbox restrictions. Either a technical solution or confirmation that manual sync is the industry standard would help greatly.
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!
Pretty much as per the title and I suspect I know the answer. Given that Foundation Models run on device, is it possible to use Foundation Models framework inside of a DeviceActivityReport? I've been tinkering with it, and all I get is errors and Sandbox restrictions. Am I missing something? Seems like a missed trick to utilise on device AI/ML with other frameworks.
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.
I am still struggling to nail down the screen time between monitoring and showing it in a DeviceActivityReport. It's always off by a couple of percentage points, which results in a difference of a couple of minutes between the time shown for my total screen time in DeviceActivityReport and DeviceActivityMonitor with a threshold set for all apps/websites/categories. In the report, I am looping through all segment (there is only 1 segement using .daily segment interval for a given day) then loop through all categories and all apps within each category and sum up all totalActivityDuration for each app. Based on avaiable documentation, that should corrolate to DeviceActivityMonitor threshold but it doesn't. Are there any differences in how these 2 places count screen time? Are there any apps/core ios services which are excluded from DeviceActivityMonitor. Would appreciate any help at all, I'm losing my mind here. My current suspicion is that Apple Developer documentation is counted twice. i.e. t
Xcode 16 DeviceActivityReport Extensions Require EXAppExtensionAttributes But App Store Rejects Them
I'm experiencing a conflict between Xcode 16's build requirements and App Store validation for DeviceActivityReport extensions. The Issue: Created a DeviceActivityReport extension using Xcode 16's template Extension builds and runs perfectly locally TestFlight upload fails with Apple saying EXAppExtensionAttributes is incorrect for widget extensions When I remove EXAppExtensionAttributes from Info.plist, local builds fail with: Appex bundle does not define an EXAppExtensionAttributes dictionary Current Info.plist (works locally, rejected by App Store): EXAppExtensionAttributes EXExtensionPointIdentifier com.apple.deviceactivityui.report-extension NSExtension NSExtensionPointIdentifier com.apple.deviceactivityui.report-extension NSExtensionPrincipalClass $(PRODUCT_MODULE_NAME).ActivityReportExtension The Problem: Xcode 16's Device Activity Report Extension template uses fileSystemSynchronizedGroups which appears to require the EX configuration format. But App Store validation rejects this for
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
Extensions
Family Controls
@Roshan_Owaves Is there any public API that allows retrieving the user’s total Screen Time (like the one shown in Settings)? If yes, what’s the correct approach — should I use 2.DeviceActivityMonitorExtension, FamilyActivitySelection, or another framework? 3 As explained in What's new in Screen Time API (starting at the seventh minute), use the DeviceActivityReport extension to access the data.
Topic:
App & System Services
SubTopic:
General
Tags:
[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:
[quote='729818021, CaliforniaJay, /thread/729818, /profile/CaliforniaJay'] Is there ay way to accomplish passing a token from the sandboxed report extension to my app? [/quote] Unfortunately, this is not possible. As you have stated, tokens are not sensitive data, but Screen Time usage data is. So Apple is not allowing ANY data to leave the sandboxed DeviceActivityReport :/
Topic:
App & System Services
SubTopic:
General
Tags:
I’m trying to integrate Screen Time usage data into my iOS app. The goal is to fetch the total time a user spends on their device (daily or weekly), and store this locally for analysis. So far, I’ve explored the DeviceActivity and FamilyControls frameworks: 1.DeviceActivityReport works but seems tied to extensions that show reports, not directly fetching raw values inside the main app. 2.I haven’t found a way to simply retrieve the total screen-on time (similar to what Settings → Screen Time shows). My questions: 1.Is there any public API that allows retrieving the user’s total Screen Time (like the one shown in Settings)? If yes, what’s the correct approach — should I use 2.DeviceActivityMonitorExtension, FamilyActivitySelection, or another framework? 3.If not, is it expected that this data is only available in the Settings app and not exposed to developers? Any guidance or official confirmation would be really helpful. Thanks in advance!
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
[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
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
Tags:
Hi everyone, I’m experimenting with the new ScreenTime DeviceActivityReport view in SwiftUI (iOS 17 / Xcode 15). My goal is to show the report inside a Button (or, more generally, capture any tap on it) so that I can push a detail screen when the user selects it. Here’s the minimal code that reproduces the issue: import FamilyControls import DeviceActivity import SwiftUI struct ScreenTimeView: View { let center = AuthorizationCenter.shared @State private var context: DeviceActivityReport.Context = .init(rawValue: Total Activity) @State private var filter = DeviceActivityFilter( segment: .hourly( during: Calendar.current.dateInterval(of: .day, for: .now)! ), users: .all, devices: .init([.iPhone, .iPad]) ) var body: some View { ZStack { DeviceActivityReport(context, filter: filter) } .onAppear { Task { do { try await center.requestAuthorization(for: .individual) } catch { print(Authorization failed:, error) } } } } } struct ContentView: View { var body: some View { ScrollViewReader { _ in Scro