Search results for

“DeviceActivityMonitor”

143 results found

Post

Replies

Boosts

Views

Activity

Family Controls (Distribution) Entitlement - Still Pending
I have a parental control app that uses FamilyControls, ManagedSettings, and DeviceActivityMonitor across two extension targets (DeviceActivityMonitor and ShieldConfiguration). The main app target received its Family Controls (Distribution) entitlement without issue. I then submitted requests for the same entitlement for both extension targets on April 16. Both still show as Submitted with no update after 12 days. Two questions: What is the typical turnaround time for extension entitlement requests? The main app was approved relatively quickly. Is there anything additional required for extension targets beyond the standard request? I submitted through the normal entitlement request flow. I didn't include any supplementary documentation as none was requested. These are the last blocker for App Store submission. Any guidance appreciated.
1
0
129
Apr ’26
DeviceActivityCenter stops monitoring if another Screen Time app starts monitoring during the same schedule
I've downloaded another screen time app that uses DeviceActivityMonitor, and once that app starts monitoring during an active monitoring schedule on my app - my app's monitoring schedule immediately ends. Is this expected behavior? Can't find this in any of the docs, but are two separate apps allowed to monitor activities during an overlapping schedule?
1
0
874
Feb ’23
Selection To Discourage
i'm trying to make my app start blocking/shielding and app according to the selection from a familyActivityPicker. the problem that i'm having is that MyModel object is always nil when i'm accessing it inside the app extension. (DeviceActivityMonitor). can someone give me an example of the object he uses to get the applicationTokens in the app extension? an explanation on how to transfer information between the app and the app extension is also welcome.
1
0
1.3k
Oct ’21
Inconsistency in the DeviceActivityEvent callbacks
We are using the Apple ScreenTime API for monitoring the usage of device. As mentioned in the documentation (https://developer.apple.com/documentation/familycontrols), we are getting the family controls authorisation from the user. We also have added the ‘DeviceActivityMonitor’ app extension (https://developer.apple.com/documentation/deviceactivity/deviceactivitymonitor) to receive the schedule and event callbacks. We have a requirement in which we have to notify the user for every 15 minutes usage of the device in the specified interval. He can optionally select individual categories or applications for the 15 minutes notification. For monitoring the usage for individual categories or applications, we obtain the token by presenting the FamilyActivityPicker as discussed in this documentation https://developer.apple.com/documentation/familycontrols/familyactivitypicker. For simplicity in testing during the development phase, we reduced the 15 minutes to 2 minutes. The events callbacks are exp
3
0
997
Jun ’24
Device Activity Extension not being called
Hi all, I am facing a problem following the code in the Meet the Screen Time API video. I've tried scheduling the monitoring time from 00:00 to 25:59 or some other time but functions in DeviceActivityMonitor are never being called. I tried to print log from those functions, nothing shown. Is there any settings I've missed? In addition, I already changed the NSExtensionPrincipalClass value to my class name. Any help would be appreciated!
2
0
2.4k
May ’22
Best way to pause DeviceActivitySchedule
Hi everyone, I'm currently working with the Screen Time API, specifically trying to figure out the best way to pause an active, repeating schedule without disrupting future schedules. Here's the scenario: I have a repeating schedule set from 10:00 AM to 8:00 PM daily. If I need to pause the schedule temporarily, my current approach involves stopping monitoring, clearing all restrictions, and then setting a new schedule for the remaining time after the pause. However, this method cancels the repeating schedule entirely, which causes issues when the schedule is supposed to restart the next day at 10:00 AM. Instead, it starts after the pause time, which isn’t what I want. Challenges I'm Facing: Maintaining Repeating Schedules: How can I pause the schedule in a way that ensures it resumes correctly the next day at the intended time (10:00 AM)? DeviceActivityMonitor Logic: Is there a way to deactivate and reactivate the schedule through the DeviceActivityMonitor without fully stopping the monitor
1
0
963
Aug ’24
Module 'DeviceActivity' not found
I have a class that uses DeviceActivityMonitor as a subclass: // MyMonitor.swift import DeviceActivity @objc(MyMonitor) class MyMonitor: DeviceActivityMonitor { ... } In order to use SwiftUI in Objective-C, I'm importing this in my objective-c file #import MyProject-Swift.h. But, when I try to build, I get the error Module 'DeviceActivity' not found from wthin #import MyProject-Swift.h I've tried Link Binary with Libraries: I've also tried to turn on Define Modules in Build Settings -> Packaging. It just seems as though the DeviceActivity framework doesn't have a header file. Seems like it should? When I click Show in Finder in MyProject -> Frameworks -> DeviceAcitivity.framework, there is not DeviceActivity.h file in that dir (also not in the modules folder in my screenshot): Is there a way to create a header file for an apple framework? Or force the creation of one? I have also tried cleaning the build folder Here's the framework for reference: https://developer.apple.com/document
6
0
1.8k
Dec ’22
Core Data not returning results in ShieldConfiguration Extension, but works fine in other extensions
Hi everyone, I’m using Core Data in several extensions (DeviceActivityMonitor, ShieldAction, and ShieldConfiguration). It works perfectly in DeviceActivityMonitor and ShieldAction. I’m able to successfully fetch data and log the correct count using a fetch request. However, when I try the same setup in the ShieldConfiguration extension, the fetch request always returns 0 results. The CoreData and App Group setup appears to be correct since the first two extensions fetch the expected data. I’ve also previously tested storing the CoreData objects separately in a JSON-FIle using FileManager and it worked without issues—though I’d prefer not to handle manual encoding/decoding if possible. The documentation mentions that the extension runs in a sandbox, restricting network requests or moving sensitive content. But shouldn’t reading data (from a shared App Group, for instance) still be possible within the sandbox, as it is the case with the Files, what is the difference there? In my case, I only n
2
0
1.1k
Oct ’24
Screen Time API, DeviceActivity, Family Controls, Entitlements, Provisioning Profile
Hello everyone, I'm hoping to find a solution for a critical issue that is blocking my app's submission to the App Store. My app uses the Screen Time API and therefore has a main app and a DeviceActivityMonitor extension. The main app has been successfully granted the Family Controls (Distribution) entitlement. However, the DeviceActivityMonitor extension is stuck with only the Family Controls (Development) entitlement. This mismatch causes my build to fail during the archive/distribution process with the error: Provisioning profile failed qualification. Profile doesn't support Family Controls (Development). This is a hard blocker, as the extension is a mandatory part of the API. I have already filled out the entitlement request form and also contacted Developer Support (Case #102666581576), who confirmed they could not assist and directed me here. My question is: What is the correct procedure to escalate or resolve the issue of a required extension not receiving the distribution-level Famil
1
0
372
Aug ’25
Monitor DeviceActivityEvent for all categories: ActivityCategoryPolicy.all? Without using FamilyActivityPicker
Using ManagedSettings I'm able to shield all categories of applications using ActivityCategoryPolicy.all , without the user using picking categories with the FamilyActivityPicker. I would like to create a DeviceActivityMonitor which monitors events for all (or a specific) categories of apps, without the user needing to interact with the FamilyActivityPicker. Is this possible? And an extra question: is there no way to pick a specific category to shield? Just like we are able to do with ActivityCategoryPolicy.all, instead something like: ActivityCategoryPolicy.games
0
0
1.1k
Feb ’23
Stuck waiting on Family Controls distribution entitlement, first indie app, looking for guidance/timelines
Hi everyone, solo iOS dev here. I’ve built a small focus app (“Modo”) that uses Apple’s Screen Time APIs to help curb social-media overuse. In development everything works: FamilyActivityPicker for selection, a DeviceActivityMonitor extension for schedules, and ManagedSettings shields (plus uninstall guard only while “Blocked” is active). I requested the Family Controls distribution entitlement so I can ship, but my capability request has been pending for a while and I’m not sure what the usual path forward is. What I’ve already done • Submitted the capability request (Account Holder), describing the use case (self-control / digital well-being), user consent flow,. • Implemented app + DeviceActivityMonitor + ManagedSettingsUI extensions; verified the debug build has the right entitlements and behavior. • Regenerated profiles after the request; checked codesign entitlements on the built targets. • Filed a Developer Support ticket referencing the capability request. I really appreciate any tim
1
0
277
Nov ’25
Ending Live Activities When Timer Expires
Hi everyone, I'm working on an app that uses the Screen Time API, and I'm encountering an issue with Live Activities. The app runs a timer (e.g., 10 minutes), after which the intervalDidEnd method in DeviceActivityMonitor is triggered. To improve the user experience, I've implemented Live Activities to display the remaining time. However, I'm having trouble stopping the Live Activity when the timer expires and intervalDidEnd is called. It seems that the Screen Time extensions cannot detect or interact with active Live Activities, even though both share the same App Group. My Question: Since the DeviceActivityMonitor extension does not seem to be able to detect Live Activities, does anyone know if there’s a way to end a Live Activity when the timer expires without relying on a server? Using Apple’s Push Notification service feels excessive given the lightweight nature of the app, which doesn’t use server-side components. Any insights or suggestions would be greatly appreciated! Thanks!
1
0
1.1k
Aug ’24
Can I read FamilyActivitySelection the container app saved in the Device Activity Report Extension?
In the container app, use FamilyActivityPicker to select some categories & applications, and set a limit usage time. save the result in UserDefaults. in the DeviceActivityMonitor extension, read the saved selection to present the shield. it works. in the DeviceActivityReportScene extension, read the saved selection, in the report add a special icon for categories & applications with limited usage time. it does not work. in the third step, I can read the saved selection, but I can't match the selected data with DeviceActivityResults in the makeConfiguration function.
1
0
1.9k
Jul ’22
How to trigger intervalDidStart in DeviceActivity API?
I have followed the two videos about Screen time API in wwdc 21 and 22. Now i want to sheild some apps during sleeping, but I encounter some problems. Problem I faced I write my monitor and override intervalDidStart and intervalDidEnd . Here is a simplified version class Mymonitor: DeviceActivityMonitor { let store = ManagedSettingsStore() override func intervalDidStart(for activity: DeviceActivityName) { super.intervalDidStart(for: activity) store.shield.applications = selection.applicationToken } then I use deviceActivityCenter to start monitor func StartSleep (_ startTime : DateComponents) { let schedule = DeviceActivitySchedule(intervalStart: startTime, intervalEnd: DateComponents(hour: 4, minute: 0), repeats: true ) let center = DeviceActivityCenter() center.stopMonitoring([.daily]) try! center.startMonitoring(.daily, during: schedule) } However, when I use StartSleep. The applications is not shielded. I have noticed that I haven't use Mymonitor in any place. In the demo Code, it seems i just ne
2
0
1.2k
Feb ’23
Screen Time API is completely UNRELIABLE!
I've been working with the Screen Time API for almost 6 months now. I found out it's completely unreliable, testing on iOS 17.4, the DeviceActivityReport is not showing, the DeviceActivityMonitor more often than not does not fire intervalDidStart. It's very frustrating. Has anyone found out a workaround? We all know there has to be something we're doing wrong, since apps like Opal and Jono does not present those types of issues. Let's please unite our forces and find a solution. How to use this API should not be a secret!
5
0
2.1k
Apr ’24
Family Controls (Distribution) Entitlement - Still Pending
I have a parental control app that uses FamilyControls, ManagedSettings, and DeviceActivityMonitor across two extension targets (DeviceActivityMonitor and ShieldConfiguration). The main app target received its Family Controls (Distribution) entitlement without issue. I then submitted requests for the same entitlement for both extension targets on April 16. Both still show as Submitted with no update after 12 days. Two questions: What is the typical turnaround time for extension entitlement requests? The main app was approved relatively quickly. Is there anything additional required for extension targets beyond the standard request? I submitted through the normal entitlement request flow. I didn't include any supplementary documentation as none was requested. These are the last blocker for App Store submission. Any guidance appreciated.
Replies
1
Boosts
0
Views
129
Activity
Apr ’26
DeviceActivityCenter stops monitoring if another Screen Time app starts monitoring during the same schedule
I've downloaded another screen time app that uses DeviceActivityMonitor, and once that app starts monitoring during an active monitoring schedule on my app - my app's monitoring schedule immediately ends. Is this expected behavior? Can't find this in any of the docs, but are two separate apps allowed to monitor activities during an overlapping schedule?
Replies
1
Boosts
0
Views
874
Activity
Feb ’23
Selection To Discourage
i'm trying to make my app start blocking/shielding and app according to the selection from a familyActivityPicker. the problem that i'm having is that MyModel object is always nil when i'm accessing it inside the app extension. (DeviceActivityMonitor). can someone give me an example of the object he uses to get the applicationTokens in the app extension? an explanation on how to transfer information between the app and the app extension is also welcome.
Replies
1
Boosts
0
Views
1.3k
Activity
Oct ’21
Inconsistency in the DeviceActivityEvent callbacks
We are using the Apple ScreenTime API for monitoring the usage of device. As mentioned in the documentation (https://developer.apple.com/documentation/familycontrols), we are getting the family controls authorisation from the user. We also have added the ‘DeviceActivityMonitor’ app extension (https://developer.apple.com/documentation/deviceactivity/deviceactivitymonitor) to receive the schedule and event callbacks. We have a requirement in which we have to notify the user for every 15 minutes usage of the device in the specified interval. He can optionally select individual categories or applications for the 15 minutes notification. For monitoring the usage for individual categories or applications, we obtain the token by presenting the FamilyActivityPicker as discussed in this documentation https://developer.apple.com/documentation/familycontrols/familyactivitypicker. For simplicity in testing during the development phase, we reduced the 15 minutes to 2 minutes. The events callbacks are exp
Replies
3
Boosts
0
Views
997
Activity
Jun ’24
Device Activity Extension not being called
Hi all, I am facing a problem following the code in the Meet the Screen Time API video. I've tried scheduling the monitoring time from 00:00 to 25:59 or some other time but functions in DeviceActivityMonitor are never being called. I tried to print log from those functions, nothing shown. Is there any settings I've missed? In addition, I already changed the NSExtensionPrincipalClass value to my class name. Any help would be appreciated!
Replies
2
Boosts
0
Views
2.4k
Activity
May ’22
Best way to pause DeviceActivitySchedule
Hi everyone, I'm currently working with the Screen Time API, specifically trying to figure out the best way to pause an active, repeating schedule without disrupting future schedules. Here's the scenario: I have a repeating schedule set from 10:00 AM to 8:00 PM daily. If I need to pause the schedule temporarily, my current approach involves stopping monitoring, clearing all restrictions, and then setting a new schedule for the remaining time after the pause. However, this method cancels the repeating schedule entirely, which causes issues when the schedule is supposed to restart the next day at 10:00 AM. Instead, it starts after the pause time, which isn’t what I want. Challenges I'm Facing: Maintaining Repeating Schedules: How can I pause the schedule in a way that ensures it resumes correctly the next day at the intended time (10:00 AM)? DeviceActivityMonitor Logic: Is there a way to deactivate and reactivate the schedule through the DeviceActivityMonitor without fully stopping the monitor
Replies
1
Boosts
0
Views
963
Activity
Aug ’24
Module 'DeviceActivity' not found
I have a class that uses DeviceActivityMonitor as a subclass: // MyMonitor.swift import DeviceActivity @objc(MyMonitor) class MyMonitor: DeviceActivityMonitor { ... } In order to use SwiftUI in Objective-C, I'm importing this in my objective-c file #import MyProject-Swift.h. But, when I try to build, I get the error Module 'DeviceActivity' not found from wthin #import MyProject-Swift.h I've tried Link Binary with Libraries: I've also tried to turn on Define Modules in Build Settings -> Packaging. It just seems as though the DeviceActivity framework doesn't have a header file. Seems like it should? When I click Show in Finder in MyProject -> Frameworks -> DeviceAcitivity.framework, there is not DeviceActivity.h file in that dir (also not in the modules folder in my screenshot): Is there a way to create a header file for an apple framework? Or force the creation of one? I have also tried cleaning the build folder Here's the framework for reference: https://developer.apple.com/document
Replies
6
Boosts
0
Views
1.8k
Activity
Dec ’22
Core Data not returning results in ShieldConfiguration Extension, but works fine in other extensions
Hi everyone, I’m using Core Data in several extensions (DeviceActivityMonitor, ShieldAction, and ShieldConfiguration). It works perfectly in DeviceActivityMonitor and ShieldAction. I’m able to successfully fetch data and log the correct count using a fetch request. However, when I try the same setup in the ShieldConfiguration extension, the fetch request always returns 0 results. The CoreData and App Group setup appears to be correct since the first two extensions fetch the expected data. I’ve also previously tested storing the CoreData objects separately in a JSON-FIle using FileManager and it worked without issues—though I’d prefer not to handle manual encoding/decoding if possible. The documentation mentions that the extension runs in a sandbox, restricting network requests or moving sensitive content. But shouldn’t reading data (from a shared App Group, for instance) still be possible within the sandbox, as it is the case with the Files, what is the difference there? In my case, I only n
Replies
2
Boosts
0
Views
1.1k
Activity
Oct ’24
Screen Time API, DeviceActivity, Family Controls, Entitlements, Provisioning Profile
Hello everyone, I'm hoping to find a solution for a critical issue that is blocking my app's submission to the App Store. My app uses the Screen Time API and therefore has a main app and a DeviceActivityMonitor extension. The main app has been successfully granted the Family Controls (Distribution) entitlement. However, the DeviceActivityMonitor extension is stuck with only the Family Controls (Development) entitlement. This mismatch causes my build to fail during the archive/distribution process with the error: Provisioning profile failed qualification. Profile doesn't support Family Controls (Development). This is a hard blocker, as the extension is a mandatory part of the API. I have already filled out the entitlement request form and also contacted Developer Support (Case #102666581576), who confirmed they could not assist and directed me here. My question is: What is the correct procedure to escalate or resolve the issue of a required extension not receiving the distribution-level Famil
Replies
1
Boosts
0
Views
372
Activity
Aug ’25
Monitor DeviceActivityEvent for all categories: ActivityCategoryPolicy.all? Without using FamilyActivityPicker
Using ManagedSettings I'm able to shield all categories of applications using ActivityCategoryPolicy.all , without the user using picking categories with the FamilyActivityPicker. I would like to create a DeviceActivityMonitor which monitors events for all (or a specific) categories of apps, without the user needing to interact with the FamilyActivityPicker. Is this possible? And an extra question: is there no way to pick a specific category to shield? Just like we are able to do with ActivityCategoryPolicy.all, instead something like: ActivityCategoryPolicy.games
Replies
0
Boosts
0
Views
1.1k
Activity
Feb ’23
Stuck waiting on Family Controls distribution entitlement, first indie app, looking for guidance/timelines
Hi everyone, solo iOS dev here. I’ve built a small focus app (“Modo”) that uses Apple’s Screen Time APIs to help curb social-media overuse. In development everything works: FamilyActivityPicker for selection, a DeviceActivityMonitor extension for schedules, and ManagedSettings shields (plus uninstall guard only while “Blocked” is active). I requested the Family Controls distribution entitlement so I can ship, but my capability request has been pending for a while and I’m not sure what the usual path forward is. What I’ve already done • Submitted the capability request (Account Holder), describing the use case (self-control / digital well-being), user consent flow,. • Implemented app + DeviceActivityMonitor + ManagedSettingsUI extensions; verified the debug build has the right entitlements and behavior. • Regenerated profiles after the request; checked codesign entitlements on the built targets. • Filed a Developer Support ticket referencing the capability request. I really appreciate any tim
Replies
1
Boosts
0
Views
277
Activity
Nov ’25
Ending Live Activities When Timer Expires
Hi everyone, I'm working on an app that uses the Screen Time API, and I'm encountering an issue with Live Activities. The app runs a timer (e.g., 10 minutes), after which the intervalDidEnd method in DeviceActivityMonitor is triggered. To improve the user experience, I've implemented Live Activities to display the remaining time. However, I'm having trouble stopping the Live Activity when the timer expires and intervalDidEnd is called. It seems that the Screen Time extensions cannot detect or interact with active Live Activities, even though both share the same App Group. My Question: Since the DeviceActivityMonitor extension does not seem to be able to detect Live Activities, does anyone know if there’s a way to end a Live Activity when the timer expires without relying on a server? Using Apple’s Push Notification service feels excessive given the lightweight nature of the app, which doesn’t use server-side components. Any insights or suggestions would be greatly appreciated! Thanks!
Replies
1
Boosts
0
Views
1.1k
Activity
Aug ’24
Can I read FamilyActivitySelection the container app saved in the Device Activity Report Extension?
In the container app, use FamilyActivityPicker to select some categories & applications, and set a limit usage time. save the result in UserDefaults. in the DeviceActivityMonitor extension, read the saved selection to present the shield. it works. in the DeviceActivityReportScene extension, read the saved selection, in the report add a special icon for categories & applications with limited usage time. it does not work. in the third step, I can read the saved selection, but I can't match the selected data with DeviceActivityResults in the makeConfiguration function.
Replies
1
Boosts
0
Views
1.9k
Activity
Jul ’22
How to trigger intervalDidStart in DeviceActivity API?
I have followed the two videos about Screen time API in wwdc 21 and 22. Now i want to sheild some apps during sleeping, but I encounter some problems. Problem I faced I write my monitor and override intervalDidStart and intervalDidEnd . Here is a simplified version class Mymonitor: DeviceActivityMonitor { let store = ManagedSettingsStore() override func intervalDidStart(for activity: DeviceActivityName) { super.intervalDidStart(for: activity) store.shield.applications = selection.applicationToken } then I use deviceActivityCenter to start monitor func StartSleep (_ startTime : DateComponents) { let schedule = DeviceActivitySchedule(intervalStart: startTime, intervalEnd: DateComponents(hour: 4, minute: 0), repeats: true ) let center = DeviceActivityCenter() center.stopMonitoring([.daily]) try! center.startMonitoring(.daily, during: schedule) } However, when I use StartSleep. The applications is not shielded. I have noticed that I haven't use Mymonitor in any place. In the demo Code, it seems i just ne
Replies
2
Boosts
0
Views
1.2k
Activity
Feb ’23
Screen Time API is completely UNRELIABLE!
I've been working with the Screen Time API for almost 6 months now. I found out it's completely unreliable, testing on iOS 17.4, the DeviceActivityReport is not showing, the DeviceActivityMonitor more often than not does not fire intervalDidStart. It's very frustrating. Has anyone found out a workaround? We all know there has to be something we're doing wrong, since apps like Opal and Jono does not present those types of issues. Let's please unite our forces and find a solution. How to use this API should not be a secret!
Replies
5
Boosts
0
Views
2.1k
Activity
Apr ’24