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
Search results for
DeviceActivityReport
118 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
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:
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
I want to add a widget to my app that will display the # of pickups the user has for the day. I have the DeviceActivityReport working in the main app but can't get it to display in the widget since it is not a supported view for widgets. Is there any workaround for getting this view to the widget? I tried converting the DeviceActivityReport view to a UI image thinking maybe that would be a way to use a widget approved view type but ImageRenderer seems to fail to render an image for the view (which is just a Text view). To summarize my questions: Is it possible to display a DeviceActivityReport in a widget? If so, what is the best practice? Is converting the DeviceActivityReport view into an image and displaying that in a widget an option? Here's my attempt to convert the DeviceActivityReport view into a UIImage: import SwiftUI import _DeviceActivity_SwiftUI struct PickupsDeviceActivityReport: View { @State private var context: DeviceActivityReport.Context = .totalA
[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:
Hello Apple Developers, I've encountered an issue while working on a DeviceActivityReport in Swift. The problem arises when attempting to use the Context type from DeviceActivityReport. Here is the snippet of the code causing the problem: import DeviceActivity import SwiftUI 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 scene will represent. let context: DeviceActivityReport.Context = .totalActivity // Define the custom configuration and the resulting view for this report. let content: (String) -> TotalActivityView func makeConfiguration(representing data: DeviceActivityResults) async -> String { // Reformat the data into a configuration that can be used to
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:
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:
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
/Users/varunashokbhaisidpara/Desktop/Screenshot 2024-11-15 at 5.43.44 PM.png This error occurs When I try to upload an app on the test flight or App Store. I checked Automatically manage signing in the main target. and i have added extensions DeviceActivityMonitorExtension, ShieldConfigurationExtension, ShieldActionExtension, DeviceActivityReport. and all have selected Automatically manage signing in the target > signing and capability. pls provide me with an exact solution set by step. Thank you
Hi guys, I’m writing an app that integrates Screen Time API more specifically one that has only DeviceActivityReport. The app runs as expected but I have an issue when pushing it to AppStoreConnect: Provisioning profile failed qualification: Profile doesn't support Family Controls (Development). Provisioning profile failed qualification: Profile doesn't include the com.apple.developer.family-controls entitlement. Provisioning profile failed qualification: Profile doesn't support Family Controls (Development). Provisioning profile failed qualification: Profile doesn't include the com.apple.developer.family-controls entitlement. My app has Family Controls (Development) set in Capabilities, entitlement file, provisioning profile and distribution certificates. I have already requested Apple for the entitlement key for Family Controls (I’m waiting for them to reply). So, I have few questions now: Can I distribute a build for internal testers via TestFlight without waiting for Apple’s reply to my request?
Topic:
App Store Distribution & Marketing
SubTopic:
TestFlight
Tags:
Entitlements
TestFlight
Family Controls
Hello! I am developing an app using the Screen Time API. Everything is good, but I have a problem with DeviceActivityReport. On the child’s device, stats are synced to the app in about 1-5 minutes. However, on the parent’s device, it can take around an hour or more. How can I make the stats sync faster between the child’s device and the parent’s device? How I Implemented It @Published var context: DeviceActivityReport.Context = .init(Time Limit) let filter = DeviceActivityFilter( segment: .daily( during: Calendar.current.dateInterval(of: .day, for: .now)! ), users: .children, devices: .all, applications: applicationTokens ) DeviceActivityReport(viewModel.context, filter: viewModel.filter) .frame(maxHeight: viewModel.maxReportHeight) In the Report Extension (Test Code) for await d in data { result += device.name=(d.device.name ?? ) result += nuser.appleID=(d.user.appleID ?? ) result += ngivenName=(d.user.nameComponents?.givenName ?? ) result += nrole=(d.user.role.rawValue) for await activity
There is frequently a delay of a few seconds before a DeviceActivityReport renders its view generated from the DeviceActivityReportExtension. It will also sometimes flash with zero data before hydrating with the real activity data (tested with extension code taken directly from XCode boilerplate) Is there a way to be notified when the DeviceActivityReport renders successfully or is still processing, i.e. so a loading indicator can be presented while the extension runs? Thanks!
Hey we are experiencing the same issue here ! With the exact same context, we asked our user to un-select Share Across Devices, and they get notifications showing a lot more screen time then is even shown within the DeviceActivityReport
Topic:
App & System Services
SubTopic:
General
Tags:
Hi everyone, I’m developing a parental control app using Apple's ScreenTime API, and I need to display ScreenTime data separately for each child in a family. The API offers options like .children and .all, but I’m looking for the best way to reliably filter and show data for a single child within the app. I’ve seen other apps like Ohana successfully implement this feature, even the apple official family screen time feature has this where parents can view ScreenTime data for each child individually. I want to achieve a similar experience in my app, ensuring that if a parent selects John, the app only displays John's ScreenTime, without mixing in data from his siblings. Here’s the approach I’m considering using DeviceActivityFilter and DeviceActivityReport to target data for a specific child: let filter = DeviceActivityFilter( segment: .children, intervals: .everyDay ) let report = DeviceActivityReport( filter: filter ) { (data) in // Process and separate data for each child if let activityDat