Search results for

DeviceActivityReport

118 results found

Post

Replies

Boosts

Views

Activity

How can I access app usage data from other apps in iOS?
Hi, I’m developing an iOS application and want to explore if there are any official methods available to monitor or retrieve information about the usage patterns of other apps installed on a user’s device — such as launch time, duration of use, or app switching behavior. I understand Apple enforces strict privacy policies. My question is: Are there any APIs or frameworks (public or private) that allow reading app usage data from other apps? Can Screen Time or DeviceActivityReport frameworks be leveraged for such use? Would an app like this be eligible for App Store approval, or would it require special entitlements? My intent is not to violate privacy, but to explore if Apple allows any of this under Screen Time APIs or family usage scenarios. Any insights or guidance would be appreciated! Thanks, [Your Name]
1
0
94
May ’25
Recently used applications on guardian phone - FamilyControls, DeviceActivityReport
For an iOS app that runs in both child and parent mode across iOS devices. On the child device, with Family Controls enabled using .child permissions via AuthorizationCenter.requestAuthorization(for: .child). Is any way to display a list of recently used apps by the child on the parent (guardian) device, in a privacy-preserving and Apple-compliant way?
1
0
136
May ’25
How can I open and write to an SQLite database from my DeviceActivityReport Extension?
Hello everyone, I’m working on an iOS app that uses the new DeviceActivity framework to monitor and report user screen‐time in an extension (DeviceActivityReportExtension). I need to persist my processed screen‐time data into a standalone SQLite database inside the extension, but I’m running into issues opening and writing to the database file. Here’s what I’ve tried so far: import UIKit import DeviceActivity import SQLite3 class DeviceActivityReportExtension: DeviceActivityReportExtension { private var db: OpaquePointer? override func didReceive(_ report: DeviceActivityReport) async { // 1. Construct path in app container: let containerURL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: group.com.mycompany.myapp) let dbURL = containerURL?.appendingPathComponent(ScreenTimeReports.db) // 2. Open database: if sqlite3_open(dbURL?.path, &db) != SQLITE_OK { print(❌ Unable to open database at (dbURL?.path ?? unknown path)) return } defer { sqlite3_close(db) } // 3. Create tabl
1
0
180
May ’25
Device Activity Report Not showing any information
All After about 20 hours straight of working on this and having scrapped it twice I am realizing I should have asked everyone here for help. I am just trying to get device activity report extension to work inside an existing app. I have been heavily using family controls, managedsettings and deviceactivity and decided it would be nice to output some of the app usage so the User (parent) can see their children's app usage. I installed the target via xcode, confirmed group names match, and think I have it embedded correctly but when I run the app and call the view within the extension to show minutes used by any apps it just shows no time has been used. In addition, when I put print statements into the extension they do not show up in console. I have confirmed the main app target->Build phases->Link binary with Libraries has: ManagedSettings.framework FamilyControls.Framework DeviceActivity.framework I have confirmed in xcode that the main app target->Build phases -> Embed Foundation Extensions has:
3
0
379
Apr ’25
Label from ApplicationToken Inside of DeviceActivityReport Not Showing
tl;dr can we use Label(application token) inside of a DeviceActivityReport? I’m working on an app that uses the DeviceActivityReport extension to show a user’s screen time breakdown. The app was working fine in a setup where my main app had the Distribution Family Controls capability and all the extensions had the Development Family Controls capability. However, this caused provisioning issues when I tried to create a test flight build. I then removed the development capabilities from the extensions, and now everything works fine except oddly the Labels in the DeviceActivityReport no longer show anything. They worked fine before, and the same label logic is working 100% fine inside my main app. Anyone encounter this before?
1
0
239
Mar ’25
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
500
Feb ’25
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
DeviceActivityReport fails to display SceneView
I am trying to return a SceneView from a DeviceActivityReport. I have my DeviceActivityReportExtension correctly set up and I am able to display a view with text or other UI elements in it, but attempting to return a SceneView as part of the body just won't display. I have this example. When I display this SceneView in my main app, it displays correctly. When I put the same code inside the DeviceActivityReportExtension, the scene does not show up and an error failed to create a gl context appears repeatedly in the console. I'm pretty stumped and would appreciate any suggestions. import SwiftUI import SceneKit struct TestScene: View { var scene: SCNScene? { SCNScene(named: art.scnassets/environment.scn) } var cameraNode: SCNNode? { let cameraNode = SCNNode() cameraNode.camera = SCNCamera() cameraNode.position = SCNVector3(x: 0, y: 0, z: 2) return cameraNode } var body: some View { SceneView( scene: scene, pointOfView: cameraNode, options: [ .allowsCameraControl, .autoenablesDefaultLighting, .temporalA
2
0
521
Jan ’25
Reply to Struggling to display DeviceActivityReport view in a widget
[quote='743998022, Frameworks Engineer, /thread/724041?answerId=743998022#743998022'] Unfortunately, displaying a DeviceActivityReport in a widget is not currently supported. Please file an enhancement request using Feedback Assistant. Thanks in advance! [/quote] Hello @Frameworks Engineer! Is there any update on this? It’s now exactly two years since this was brought up…
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’25
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
423
Jan ’25