Search results for

DeviceActivityReport

118 results found

Post

Replies

Boosts

Views

Activity

Monitoring Connection Status to a DeviceActivityReport App Extension
Hello, I've been working with an app that leverages a DeviceActivityReport app extension. I want to ensure that the main app can gracefully handle scenarios where the connection to the app extension might get terminated unexpectedly. Can anyone guide me on how to detect from the main app when the connection to the app extension gets terminated? I believe being able to detect this would allow for better error handling and potentially reduce instances where the UI appears blank due to a lost connection. Thank you for any insights or advice on this topic.
1
0
720
Sep ’23
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.8k
Sep ’23
Detecting Termination and Re-establishing Connection with DeviceActivityReport App Extension
Hello, I have an iOS app using the DeviceActivityReport app extension. Occasionally, the extension gets terminated (likely due to reaching memory limit**), which in turn disrupts the connection with the main app. How can the main app detect when the DeviceActivityReport extension has been terminated due to memory constraints, and what's the best way to re-establish the connection afterward? Thanks in advance for your insights and suggestions! ** I'm also unsure why the extension should be reaching its memory limit. When profiling the extension in XCode, it never reaches above 15MB, and I know the limit is 100MB. It's not doing anything out of the ordinary - and I've seen very similar complaints about DeviceActivityReport terminating on these forums. Any thoughts on how to prevent termination in the first place would also be super helpful!
3
0
1.4k
Sep ’23
Reply to Detecting Termination and Re-establishing Connection with DeviceActivityReport App Extension
I've encountered the same issue, but based on my testing, it's not because of the 100MB limit. It's actually because iOS, when it's running low on resources, prioritizes cleaning up processes with lower priority. DeviceActivityReport falls into that category. You can try playing games or watching videos, and it's almost a guaranteed way to reproduce the issue. However, successfully reloading it is indeed quite challenging. I wonder how other apps handle this?
Topic: App & System Services SubTopic: General Tags:
Sep ’23
Reply to Detecting Termination and Re-establishing Connection with DeviceActivityReport App Extension
Hey ! We encounter similar issues in the past, and didn't find any proper documented way to monitor the DeviceActivityReport extension state, or to prevent crashes from happening. You can provide a way for your user to reload the view himself in case of crash using regular SwiftUI methods. We've opened several radars, some of them more than a year ago, without any answer at the moment. I would suggest you to do the same, the more they are, the more likely they'll fix it ! Regards !
Topic: App & System Services SubTopic: General Tags:
Sep ’23
Unable to get app wise usage duration using Screen time API
I am working with DeviceActivity to get the screen time. I always have screen time zero second (0s). But it should have some value. I am selecting apps using familyActivityPicker and passing the tokens in the filter. @State private var context: DeviceActivityReport.Context = .init(rawValue: Total Activity) filter = DeviceActivityFilter( segment: .daily( during: Calendar.current.dateInterval( of: .weekOfYear, for: .now )! ), users: .all, devices: .init([.iPhone, .iPad]), applications: applications, categories: categories, webDomains: webDomains ) DeviceActivityReport(context, filter: filter) I saw various posts regarding this, but nothing working in my side. I am unable to identify the issue of getting zero second all the time.
1
0
716
Aug ’23
DeviceActivityMonitor not working on development since I've had my Family Controls (Distribution) entitlement approved
I recently got approved for the Family Controls (Distribution) entitlement, and since then it seems that I cannot use the DeviceActivityMonitor extension on the dev environment anymore. I've tried attaching a debugger to the DeviceActivityMonitor process but it's never called so does not attach, and I can't see why it is not attaching. I've tried reverted back to old versions which I know definitely worked, and it's still not working... However, the DeviceActivityReport extension seems to be working fine. Any help or advice on how I can actually debug this would be greatly appreciated!
1
0
947
Aug ’23
DeviceActivityReport - filtering applications for makeConfiguration
I am trying to filter my DeviceActivityReport to only show activity for the specific app tokens I pass in. Right now, it shows activity for all apps. Is there something else I need to do in makeConfiguration so that it only filters the application tokens that I'm filtering by? filter = DeviceActivityFilter(segment: .hourly(during: dateInterval), applications: task.selection.applicationTokens) 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 create // the report's view. let formatter = DateComponentsFormatter() formatter.allowedUnits = [.minute, .second] formatter.unitsStyle = .abbreviated formatter.zeroFormattingBehavior
1
0
1.1k
Aug ’23
How to find out if an app extension process is alive on iOS?
Hey 👋 I have an extension of type Device Activity Report Extension. Is there a way to know from the parent app if the extension process is alive? the process name is DeviceActivityReportService Why would I like to detect that? The extension sometimes crashes due to memory pressure and I would like to reload the view automatically when this happens. This issue happens under normal app use — the user switches quickly between two tabs that have DeviceActivityReport. I filed a bug for this with a sample project to replicate (12192929) Here is an output from the Console app when the DeviceActivityReportService is killed and the UI disappears: kernel memorystatus: killing process 33061 [DeviceActivityReportService] in high band FOREGROUND (100) - memorystatus_available_pages: 68660 kernel DeviceActivityReportService[33061] Corpse allowed 1 of 5 SpringBoard [xpcservice<com.apple.DeviceActivityUI.DeviceActivityReportService([application<com.labalab.Screen-Time.marcin>:33046])>:33061] Workspace c
2
0
1.7k
Aug ’23
Reply to [iOS 17] Screen Time connection breaks randomly multiple times per day
We experience the same issue on our app, and we filled a bug report as well -> FB12235755. The issue seems to happen when screentime permission have been granted prior to iOS 17. In our testing, everything based on DeviceActivityReport fails to render until you reinstall the app. here's what we see in the logs: Failed to discover the client's extension: Error Domain=DeviceActivityReportService.ReportViewController.ClientError Code=2 (null) VS terminated with error: Error Domain=_UIViewServiceErrorDomain Code=1 (null) UserInfo={Terminated=disconnect method} I agree this is a big concern for us as well, we don't want to ask all of our users to reinstall the app after updating to iOS 17. This is also showing how little control we have on DeviceActivityReport views, we cannot know if they are loading, if they errored with the public API, we opened a enhancement radar on this about a year ago (FB10754858).
Topic: App & System Services SubTopic: General Tags:
Jun ’23
Critical bugs (and regressions) remaining after release
Hello! I've filed bugs/radar/feedback that are reproducible, with Xcode project attached, and videos. However, they haven't gotten attention (even across iOS releases). Maybe they aren't seen, so I'll try to more actively advertise them here. Recent regression starting iOS 16.1 where FamilyActivityPicker will sometimes fail to properly expand and show all applications (makes it difficult for users to select applications or know what is going on): FB11737092 Outstanding bug that likely has been there since the start of Screen Time API being released to .individual. DeviceActivityReport has some odd concurrency issues where it shows data for the wrong reports. If one debugs DeviceActivityReportExtension with 2+ scenes, each scene can receive data from an unrelated scene. The debugger shows multiple calls to func makeConfiguration(representing data: DeviceActivityResults across many threads when you'd think only one call would be necessary. If one uses only a SINGLE scene, these issues do not occur. FB1
3
0
1.5k
Apr ’23