Search results for

“DeviceActivityReport”

127 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
Screen Time API distribute to internal testers on TestFlight via AppStoreConnect
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?
1
0
653
Oct ’24
ApplicationActivity.application.localizedDisplayName always nil
When use the DeviceActivity api to create a DeviceActivityReport, all of the ApplicationActivity.application objects have a nil localizedDisplayName. ApplicationActivity(application: ManagedSettings.Application(bundleIdentifier: Optional(com.netflix.Netflix), token: nil, localizedDisplayName: nil), totalActivityDuration: 0.0, numberOfPickups: 0, numberOfNotifications: 1, isTrusted: true) I see in the documentation for Application.localizedDisplayName the following: In an extension that provides shield configurations, this property provides the app’s name. When you access this property outside that extension, the value is nil. See ShieldConfigurationDataSource in the Managed Settings UI framework for more information. I am using the property in an extension that provides shield configurations so it should not be nil. I do see that ManagedSettings.ActivityCategory.localizedDisplayName is set properly and that in its documentation that it has the same requirement with shield configurations. CategoryActi
1
0
1.5k
Jul ’22
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
Jun ’23
Switching tabs crashes "Screen Time" process
I think I have found a bug in the Apple Screen Time API. I have filed it via a Feedback Assistant, but I can see that some apps have somehow found a workaround to this issue — so wondering how they did it. The issue: Create a simple two tabs view: TabView { Tab1View() .tabItem { Label(Tab 1, systemImage: 1.circle.fill) } Tab2View() .tabItem { Label(Tab 2, systemImage: 2.circle.fill) } } Each tab has a different Screen Time report, e.g. struct Tab2View: View { var body: some View { DeviceActivityReport(Utils.weeklyContext, filter: Utils.filterWeekly) } } When you switch the tabs quickly, the Screen Time process crashes, leaving both reports blank. The size of the DeviceReportActivity remains the same (it's just blank), so there is no way to tell if it crashed. Also, there is no way to know that the Screen Time process has crashed. This leaves the app in an unusable state. Here is a video illustrating the issue: https://www.youtube.com/watch?v=WrRpohf9tmw&ab_channel=MarcinCzech The code is here: ht
0
0
694
May ’23
Access Screen Time total usage from main app when using DeviceActivityReportExtension
I am building a simple iOS app that shows the total phone usage time for today using the Screen Time APIs. Architecture: Main app → requests authorization using AuthorizationCenter.shared.requestAuthorization(for: .individual) → displays a DeviceActivityReport Report extension → DeviceActivityReportExtension → calculates total usage using DeviceActivityResults → shows the number in a SwiftUI view The report works correctly. The extension successfully calculates the total usage and displays it on screen. Example logic inside the report extension: for await activityData in data { for await segment in activityData.activitySegments { totalSeconds += segment.totalActivityDuration } } let totalMinutes = Int(totalSeconds / 60) The problem: I need the main app to access that number so I can store it daily in my own database. I tried to send the value from the extension to the main app using: App Group + UserDefaults(suiteName:) App Group + shared file (FileManager.containerURL) writing inside makeConfigurati
1
0
277
Mar ’26
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
478
Apr ’25
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
Replies
2
Boosts
0
Views
1.2k
Activity
Dec ’23
Screen Time API distribute to internal testers on TestFlight via AppStoreConnect
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?
Replies
1
Boosts
0
Views
653
Activity
Oct ’24
ApplicationActivity.application.localizedDisplayName always nil
When use the DeviceActivity api to create a DeviceActivityReport, all of the ApplicationActivity.application objects have a nil localizedDisplayName. ApplicationActivity(application: ManagedSettings.Application(bundleIdentifier: Optional(com.netflix.Netflix), token: nil, localizedDisplayName: nil), totalActivityDuration: 0.0, numberOfPickups: 0, numberOfNotifications: 1, isTrusted: true) I see in the documentation for Application.localizedDisplayName the following: In an extension that provides shield configurations, this property provides the app’s name. When you access this property outside that extension, the value is nil. See ShieldConfigurationDataSource in the Managed Settings UI framework for more information. I am using the property in an extension that provides shield configurations so it should not be nil. I do see that ManagedSettings.ActivityCategory.localizedDisplayName is set properly and that in its documentation that it has the same requirement with shield configurations. CategoryActi
Replies
1
Boosts
0
Views
1.5k
Activity
Jul ’22
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
Replies
2
Boosts
0
Views
1.7k
Activity
Jun ’23
Switching tabs crashes "Screen Time" process
I think I have found a bug in the Apple Screen Time API. I have filed it via a Feedback Assistant, but I can see that some apps have somehow found a workaround to this issue — so wondering how they did it. The issue: Create a simple two tabs view: TabView { Tab1View() .tabItem { Label(Tab 1, systemImage: 1.circle.fill) } Tab2View() .tabItem { Label(Tab 2, systemImage: 2.circle.fill) } } Each tab has a different Screen Time report, e.g. struct Tab2View: View { var body: some View { DeviceActivityReport(Utils.weeklyContext, filter: Utils.filterWeekly) } } When you switch the tabs quickly, the Screen Time process crashes, leaving both reports blank. The size of the DeviceReportActivity remains the same (it's just blank), so there is no way to tell if it crashed. Also, there is no way to know that the Screen Time process has crashed. This leaves the app in an unusable state. Here is a video illustrating the issue: https://www.youtube.com/watch?v=WrRpohf9tmw&ab_channel=MarcinCzech The code is here: ht
Replies
0
Boosts
0
Views
694
Activity
May ’23
Access Screen Time total usage from main app when using DeviceActivityReportExtension
I am building a simple iOS app that shows the total phone usage time for today using the Screen Time APIs. Architecture: Main app → requests authorization using AuthorizationCenter.shared.requestAuthorization(for: .individual) → displays a DeviceActivityReport Report extension → DeviceActivityReportExtension → calculates total usage using DeviceActivityResults → shows the number in a SwiftUI view The report works correctly. The extension successfully calculates the total usage and displays it on screen. Example logic inside the report extension: for await activityData in data { for await segment in activityData.activitySegments { totalSeconds += segment.totalActivityDuration } } let totalMinutes = Int(totalSeconds / 60) The problem: I need the main app to access that number so I can store it daily in my own database. I tried to send the value from the extension to the main app using: App Group + UserDefaults(suiteName:) App Group + shared file (FileManager.containerURL) writing inside makeConfigurati
Replies
1
Boosts
0
Views
277
Activity
Mar ’26
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:
Replies
3
Boosts
0
Views
478
Activity
Apr ’25