Search results for

“DeviceActivityReport”

139 results found

Post

Replies

Boosts

Views

Activity

Device Activity Report only for Selected Apps
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
2
0
1k
Jul ’24
Device Activity Report only for Selected Apps
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
4
0
1.2k
Jul ’24
Device Activity Reports are returning a blank screen in release mode
There is an inconsistent issue when views are rendered from the Device Activity Report Extension. This issue is noticeable only on release versions and it works fine in debug mode. Around 80% of the times, the Report Views return blank screen and this is only the case when a weekly/monthly filter is used. Although, it works as expected for daily report views. My questions are: How are all the Report Activity Views working fine in debug mode but not in release mode? How the daily activity filter works fine in the release mode but the weekly/monthly filters don't work? Is this because of a memory limit issue in the extension? As of now, I have the family-controls(distribution) entitlement only for the app and for the extensions I only have family-controls(development) entitlement. Do I need to request for family-controls(Distribution) entitlement even for the extensions? I have seen threads on the forum mentioning the blank screen issue associated with the DeviceActivityReport but haven't found a solut
4
0
2.1k
Apr ’24
DeviceActivity App Extension Lifecycle
I've asked several questions about DeviceActivity performance issues where the answers have cited limitations to the lifecycle of the DeviceActivity App Extensions. For example: Question about DeviceActivityReport lag and performance issues responded letting me know that my extension may be exceeding its memory limit of 100MB and subsequently getting terminated by the system. Question about async tasks in DeviceActivityMonitor responded letting me know that the monitor extensions lifecycle ends and is terminated by the system once all synchronous functions return, so it has no async support. I couldn't find either of these facts documented anywhere, and the DeviceActivity docs mention very little about how the extensions actually work. In general, it seems like these app extensions are basically a black box. Is there any additional comprehensive documentation about the true lifecycle of the app extensions, their limitations, and how apps should handle error cases (like the system terminating the app
1
0
1k
Mar ’23
Screen Time API - Get user total screen time
I’m trying to integrate Screen Time usage data into my iOS app. The goal is to fetch the total time a user spends on their device (daily or weekly), and store this locally for analysis. So far, I’ve explored the DeviceActivity and FamilyControls frameworks: 1.DeviceActivityReport works but seems tied to extensions that show reports, not directly fetching raw values inside the main app. 2.I haven’t found a way to simply retrieve the total screen-on time (similar to what Settings → Screen Time shows). My questions: 1.Is there any public API that allows retrieving the user’s total Screen Time (like the one shown in Settings)? If yes, what’s the correct approach — should I use 2.DeviceActivityMonitorExtension, FamilyActivitySelection, or another framework? 3.If not, is it expected that this data is only available in the Settings app and not exposed to developers? Any guidance or official confirmation would be really helpful. Thanks in advance!
2
0
470
Aug ’25
App rejected 13+ times for UIRequiredDeviceCapabilities after adding DeviceActivity extensions — what am I missing?
I've been stuck on Guideline 2.3 for two weeks now and I'm running out of ideas. My app is iPhone-only (UIDeviceFamily = [1]) and has been on the App Store since January. Version 2.1.9 passed review fine. The only change in 2.1.10 is adding two DeviceActivity extensions — a DeviceActivityMonitor and a DeviceActivityReport — for screen time-based stress detection. Every build since then gets rejected with the same message: The UIRequiredDeviceCapabilities key in the Info.plist is set up in such a way that the app will not install on the device used in review. Review devices: iPhone 14 Pro, iPhone 17 Pro Max, iPad Air M3. Here's what I've tried across 13+ submissions: UIRequiredDeviceCapabilities as [arm64] (array) — rejected Empty array [] — rejected Removed the key entirely — upload validation fails, Xcode re-injects arm64 anyway Post-build script to force [arm64] — rejected Dictionary format {arm64: true} — rejected Added com.apple.developer.family-controls to extension entitlements — rejected Enabl
3
0
734
Apr ’26
FamilyControlsAgent crashes due to internal memory limit
Disclaimer The setup of the FamilyControls capability, authorization etc. is all correct and properly working. The Issue Users complain that apps are not shown up on their parent device. Investigations For months we thought it's a syncing issue and eventually apps do show up. But another time (after already shown) they hide again. Insights We now found out, that the FamilyControlsAgent which is an internal process of iOS crashes due to exceeding their memory limit right before the picker should show up and then logs errors that it can't connect to helper process. Feedback Tickets: Including multiple sys-diagnose files, step by steps and more: FB11983206 FB11863463 FB11983304 Attention As more and more users get frustrated with it, we hope some Apple engineer sees this and helps bring attention to a fast bug fix. Maybe just increase internal memory limit threshold for such process via entitlement. FYI We also think this is the reason why the DeviceActivityReport can't show apps and crashes due this li
0
0
1.1k
Feb ’23
FamilySelectionPicker crashes due to internal memory limit
Disclaimer The setup of the FamilyControls capability, authorization etc. is all correct and properly working. The Issue Users complain that apps are not shown up on their parent device. Investigations For months we thought it's a syncing issue and eventually apps do show up. But another time (after already shown) they hide again. Insights We now found out, that the FamilyControlsAgent which is an internal process of iOS crashes due to exceeding their memory limit right before the picker should show up and then logs errors that it can't connect to helper process. Feedback Tickets: Including multiple sys-diagnose files, step by steps and more: FB11983206 FB11863463 FB11983304 Attention As more and more users get frustrated with it, we hope some Apple engineer sees this and helps bring attention to a fast bug fix. Maybe just increase internal memory limit threshold for such process via entitlement. FYI We also think this is the reason why the DeviceActivityReport can't show apps and crashes due this li
0
0
617
Feb ’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.6k
Nov ’22
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
709
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
2.0k
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
721
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
715
Mar ’26
Device Activity Report only for Selected Apps
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
Replies
2
Boosts
0
Views
1k
Activity
Jul ’24
Device Activity Report only for Selected Apps
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
Replies
4
Boosts
0
Views
1.2k
Activity
Jul ’24
Device Activity Reports are returning a blank screen in release mode
There is an inconsistent issue when views are rendered from the Device Activity Report Extension. This issue is noticeable only on release versions and it works fine in debug mode. Around 80% of the times, the Report Views return blank screen and this is only the case when a weekly/monthly filter is used. Although, it works as expected for daily report views. My questions are: How are all the Report Activity Views working fine in debug mode but not in release mode? How the daily activity filter works fine in the release mode but the weekly/monthly filters don't work? Is this because of a memory limit issue in the extension? As of now, I have the family-controls(distribution) entitlement only for the app and for the extensions I only have family-controls(development) entitlement. Do I need to request for family-controls(Distribution) entitlement even for the extensions? I have seen threads on the forum mentioning the blank screen issue associated with the DeviceActivityReport but haven't found a solut
Replies
4
Boosts
0
Views
2.1k
Activity
Apr ’24
DeviceActivity App Extension Lifecycle
I've asked several questions about DeviceActivity performance issues where the answers have cited limitations to the lifecycle of the DeviceActivity App Extensions. For example: Question about DeviceActivityReport lag and performance issues responded letting me know that my extension may be exceeding its memory limit of 100MB and subsequently getting terminated by the system. Question about async tasks in DeviceActivityMonitor responded letting me know that the monitor extensions lifecycle ends and is terminated by the system once all synchronous functions return, so it has no async support. I couldn't find either of these facts documented anywhere, and the DeviceActivity docs mention very little about how the extensions actually work. In general, it seems like these app extensions are basically a black box. Is there any additional comprehensive documentation about the true lifecycle of the app extensions, their limitations, and how apps should handle error cases (like the system terminating the app
Replies
1
Boosts
0
Views
1k
Activity
Mar ’23
Screen Time API - Get user total screen time
I’m trying to integrate Screen Time usage data into my iOS app. The goal is to fetch the total time a user spends on their device (daily or weekly), and store this locally for analysis. So far, I’ve explored the DeviceActivity and FamilyControls frameworks: 1.DeviceActivityReport works but seems tied to extensions that show reports, not directly fetching raw values inside the main app. 2.I haven’t found a way to simply retrieve the total screen-on time (similar to what Settings → Screen Time shows). My questions: 1.Is there any public API that allows retrieving the user’s total Screen Time (like the one shown in Settings)? If yes, what’s the correct approach — should I use 2.DeviceActivityMonitorExtension, FamilyActivitySelection, or another framework? 3.If not, is it expected that this data is only available in the Settings app and not exposed to developers? Any guidance or official confirmation would be really helpful. Thanks in advance!
Replies
2
Boosts
0
Views
470
Activity
Aug ’25
App rejected 13+ times for UIRequiredDeviceCapabilities after adding DeviceActivity extensions — what am I missing?
I've been stuck on Guideline 2.3 for two weeks now and I'm running out of ideas. My app is iPhone-only (UIDeviceFamily = [1]) and has been on the App Store since January. Version 2.1.9 passed review fine. The only change in 2.1.10 is adding two DeviceActivity extensions — a DeviceActivityMonitor and a DeviceActivityReport — for screen time-based stress detection. Every build since then gets rejected with the same message: The UIRequiredDeviceCapabilities key in the Info.plist is set up in such a way that the app will not install on the device used in review. Review devices: iPhone 14 Pro, iPhone 17 Pro Max, iPad Air M3. Here's what I've tried across 13+ submissions: UIRequiredDeviceCapabilities as [arm64] (array) — rejected Empty array [] — rejected Removed the key entirely — upload validation fails, Xcode re-injects arm64 anyway Post-build script to force [arm64] — rejected Dictionary format {arm64: true} — rejected Added com.apple.developer.family-controls to extension entitlements — rejected Enabl
Replies
3
Boosts
0
Views
734
Activity
Apr ’26
FamilyControlsAgent crashes due to internal memory limit
Disclaimer The setup of the FamilyControls capability, authorization etc. is all correct and properly working. The Issue Users complain that apps are not shown up on their parent device. Investigations For months we thought it's a syncing issue and eventually apps do show up. But another time (after already shown) they hide again. Insights We now found out, that the FamilyControlsAgent which is an internal process of iOS crashes due to exceeding their memory limit right before the picker should show up and then logs errors that it can't connect to helper process. Feedback Tickets: Including multiple sys-diagnose files, step by steps and more: FB11983206 FB11863463 FB11983304 Attention As more and more users get frustrated with it, we hope some Apple engineer sees this and helps bring attention to a fast bug fix. Maybe just increase internal memory limit threshold for such process via entitlement. FYI We also think this is the reason why the DeviceActivityReport can't show apps and crashes due this li
Replies
0
Boosts
0
Views
1.1k
Activity
Feb ’23
FamilySelectionPicker crashes due to internal memory limit
Disclaimer The setup of the FamilyControls capability, authorization etc. is all correct and properly working. The Issue Users complain that apps are not shown up on their parent device. Investigations For months we thought it's a syncing issue and eventually apps do show up. But another time (after already shown) they hide again. Insights We now found out, that the FamilyControlsAgent which is an internal process of iOS crashes due to exceeding their memory limit right before the picker should show up and then logs errors that it can't connect to helper process. Feedback Tickets: Including multiple sys-diagnose files, step by steps and more: FB11983206 FB11863463 FB11983304 Attention As more and more users get frustrated with it, we hope some Apple engineer sees this and helps bring attention to a fast bug fix. Maybe just increase internal memory limit threshold for such process via entitlement. FYI We also think this is the reason why the DeviceActivityReport can't show apps and crashes due this li
Replies
0
Boosts
0
Views
617
Activity
Feb ’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
Replies
3
Boosts
0
Views
1.6k
Activity
Nov ’22
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
709
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
2.0k
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
721
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
715
Activity
Mar ’26