Search results for

DeviceActivityReport

118 results found

Post

Replies

Boosts

Views

Activity

DeviceActivityMonitor unreliable with iOS 17 - any other ways to schedule tasks?
We have an app that uses the Screen Time APIs to block certain apps set by the user on a schedule: We use ManagedSettings to shield selected apps We use DeviceActivityMonitor to shield the apps automatically on a schedule set by the user. The shielding starts during the intervalDidStart callback function and ends during the intervalDidEnd callback function We are getting reports from the majority of our iOS 17 users that the app blocking schedules no longer work on iOS 17. We have tested this on our own iOS 17 devices and reproduced the behavior. But the feature still works consistently on iOS 16 devices. The app is still built using Xcode 14 instead of Xcode 15 due to another issue - the DeviceActivityReport is blank for all iOS 16 users when built in Xcode 15 (link to issue on the developer forums: https://developer.apple.com/forums/thread/735915). When testing with Xcode 15 builds, the bug appears to improve - however it still occurs intermittently. Are there any other mechanisms to run tasks on r
2
0
1.2k
Dec ’23
HELP ScreenTime API DeviceAcivityReport continious issues
Hi everyone, I've been spending my evenings on the app for around 6 months that's using Screen Time API introduced in WWDC 21 (https://developer.apple.com/videos/play/wwdc2021/10123/), I'm having many issues with this API and looking for anyone who has experience with this API, I will appreciate any help or advice I can get! I'm using DeviceActivityReport to display the dashboard with screen time usage and certain metrics. Device activity report extension runs in an isolated sandbox, which makes it harder to debug and can't make any network call or write to any storage, for privacy purposes which makes sense, but makes it very hard for development. The issue is that the process where DeviceActivityReport is running crashes for no reason frequently or doesn't run at all. The API itself has many bugs, which is backed up by my experience, Opal app developers and Screen Time even made the news with its bugs. I see the same behaviour with other apps like Opal, but they can workaround somehow it a
2
0
1.7k
Nov ’23
DeviceActivityReport Formatting
Hello everyone, I'm currently developing an app that requires Device activity report to be displayed at the click of a button. I'm having an issue where when the button is clicked and the Device activity report is displayed it pushes all other elements away from it. Is this a feature and do I need to configure this specifically with a ZStack? Or am I doing something wrong on my end? Thanks!
0
0
502
Oct ’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
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
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
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
Device Activity Report Extension Crashed when adding 3 or more reports on one screen
Activity Report Extension crashes when adding 3 or more reports on one screen. I'm trying to use the new Screen Time API from WWDC 2021 and 2022 I'm trying to show 3 reports on one screen, I created a simple SwiftUI app to demonstrate the issue where just a Text for each report is displayed. They all appear for a few seconds and then disappear with an error in the debug console. Our project is stuck because having 1 device activity report for all elements results in poor performance. The whole API seems laggy, but I'm wondering if it's an issue on my side or Apple's bug. Screen Recording https://drive.google.com/file/d/1DniOo4QN5bY56sddZJvLTKtkGLQugXRi/view?usp=share_link I'm getting the following error in the Xcode debug console 2023-09-02 22:36:37.763861-0400 TestApp3[6222:368344] [default] VS terminated with error: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 (null) UserInfo={Message=Service Connection Interrupted} All targets and the project have Deployment Target iOS 16, I'm using XCode 14.3.1,
0
0
980
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
DeviceActivityReport based views are blank on iOS 16 whith apps built with Xcode 15 beta
Hi ! We are super exited to switch to Xcode 15 when it will be released, but we have a major issue : Apps built with Xcode 15 beta fail to show DeviceActivityReport base view on iOS 16. The following message shows in the console : ] [default] 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=66, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler} 2023-07-31 14:54:12.568332+0200 Opal[57940:4651501] [default] Attempt to map database failed: permission was denied. This attempt will not be retried. 2023-07-31 14:54:12.568420+0200 Opal[57940:4651501] [db] 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=66, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler} We Opened a bug report at the end
8
0
3.1k
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