Meet the Screen Time API

RSS for tag

Discuss the WWDC21 session Meet the Screen Time API.

Posts under wwdc21-10123 tag

73 Posts

Post

Replies

Boosts

Views

Activity

Shielding Specific Contacts via Screen Time Communication Limits
Hello, Thank you Chris & Nolan for the wonderful Screen Time API demo! I would like to apply this new functionality to limit a child's communication with a specific contact selected by a parent during, "Homework" hours. I would like to configure the shield to ONLY restrict the chat log of the specified contact, not the entire Messages application. At the end of "Homework" hours I would like the child to be able to view any missed messages or calls they received, while this contact was restricted. It does not appear that a parent can specify communication limits within managed settings without using lockCellularPlan or shielding the entire app with the familyactivitypicker. Can we configure downtime restrictions using this API? If you could point me to the correct part of the framework so I can further investigate how to implement this, that would be very helpful. Thank you!
0
0
1.3k
Feb ’22
Can I get code examples of Homework app that was shown on WWDC21?
Hello, Apple! Thanks for sharing Screen Time API! Together with my team we want to develop one cool app, that is based on parent-child relationship. Unfortunately, we couldn't understand completely how Screen Time API works according documentations. Could you please provide us a code example of Homework demo app or maybe guid us on what kind of steps we must do in order to get next functionalities: Block apps on child device until parent allow to access them. Listen what apps are running on child device. We need integrate backend part that way that child will be able to deserve by his own ability to use other apps for some time. Is it possible to make such functionality in background? Looking forward for your response! Best regards Dmitriy
4
0
3.9k
Feb ’22
Is it possible to request FamilyControls authorization on simulator?
I'm getting a FamilyControlsError Code=3 when requesting authorization from a simulator signed in with a child iCloud account. When requesting authorization from a simulator signed in with a parent iCloud account I receive the expected FamilyControlsError Code=2. There's not a lot of info on resolving these errors, and the code is pretty simple: func requestAuthorization() {     AuthorizationCenter.shared.requestAuthorization { result in         switch result {         case .success():             print("Sucess...")         case .failure(let error):             print("Failed... \(error)")         }     } }
8
0
3.5k
Jan ’22
Event threshold callbacks are inconsistent
The event threshold callbacks are inconsistent. We receive the callback 30mins to 1hour late after scheduling or it stops coming suddenly. Is there any limit how many callbacks will be coming per hour or day? Sometimes I don't get the callback at all. Sometimes it works properly for the whole day(Same code without any change). Additional note: Sometimes I don't receive the schedule start call-back but the event threshold.
1
0
1.2k
Jan ’22
How does child can unblock apps for some period of time using Screen Time API?
I have created the app that uses Screen Time API (Device Activity, Managed Settings and Family Control). I have allowed on child device block and unblock apps that are selected in familyPicker, but I have to add ability to unblock these apps for some period of time. I have tried this:             do {                     center.stopMonitoring()                     try center.startMonitoring(.unblock, during: schedule, events: [.encouraged: DeviceActivityEvent(                         applications: applications.applicationTokens,                         threshold: DateComponents(second: 30)                     )])                     print("Unblock apps")                 } catch {                     print("Error")                 } Maybe I have to use another way to do it? but this doesn't work for me.
1
0
1.2k
Jan ’22
how can i have separate thresholds for different apps i selected?
i managed to shield app according to selection from the picker on the child app. i noticed that the threshold is for all the usage time of al the apps combined together. that means that if the threshold is 10 minutes and i used one of the selected apps 5 minutes and the other one for 5 minutes they both will be blocked. what i'm trying to do is that if each an app reached the threshold only it will be shielded anyone knows how to to this?
2
0
911
Nov ’21
Screen Time API FamilyActivityPicker
There are 2 types of login in the application one for Parents and one for Children. Once the parent has signed up and set his profile, then he will be able to add multiple students. Students will be able to log in to the app using the QA code provided by the parent. Once the students have logged in successfully, the Parent can set their restrictions that which applications to be restricted for use. The parent can add scheduled prompts for specific students in terms of hourly, daily, weekly, and monthly. Once the scheduled prompt arrives on the student’s device in terms of notification. The student's device-restricted apps will be locked for a specific amount of time. The student is allowed to complete a subject questionnaire to unlock their device. For eg, there will be a list of 5 questions with multiple options to choose from. If the student gives a minimum of 4 right answers the student’s device will be unlocked or it will be locked for 5 minutes if the count of the correct answers is less than 4. After the 5 minutes [Specific time - predefined] are complete, the student's device will be unlocked. We also created Apple ID for parents and children from family sharing documentation for screen time API. We also implemented authentication functionality with help of the family controls framework after approval we called FamilyActivityPicker as per provided document on family controls we got a view of all categories list but we were unable to see the application list on which depending on their category How we lock all applications depending on he got remote notification in student device  Mac OS:- Bigsur (11.4) System:- Mac mini(M1,2020) Chip:- Apple M1 Memory:- 16GB XCode:- 13
1
0
1k
Nov ’21
Not getting call back to DeviceActivityMonitor extension
Hi, Problem: Even after successful schedule creation I am not getting call backs(intervalDidStart, intervalDidEnd) to my extension I have created DeviceActivityMonitor extension by creating call Directory Extension and updated info plist with the value (com.apple.deviceactivity.monitor-extension) and updated principal class value too. I try running the extension on my demo app which has the below code,         let schedule = DeviceActivitySchedule(             intervalStart: DateComponents(hour: 10, minute: 30),             intervalEnd: DateComponents(hour: 12, minute: 15),             repeats: true,             warningTime: nil)         do {             let center = DeviceActivityCenter()             center.stopMonitoring([.daily])             try center.startMonitoring(.daily, during: schedule)             print("Schedule created")             print(center.activities)         } catch {             print(error)         }     } My extension has the below code, override func intervalDidStart(for activity: DeviceActivityName) {         super.intervalDidStart(for: activity)         print("Entered Did Start")     }     override func intervalDidEnd(for activity: DeviceActivityName) {         super.intervalDidEnd(for: activity)         print("Entered Did End")     } Please guide me to find out the issue. Thanks in advance.
2
0
2.1k
Nov ’21
applications and applicationTokens
in order to block an app i need to have a bundle identifier for the app i want to block and then pass it to the Application constructor like this: Application(bundleIdentifier: "com.apple.calculator") then i can use it inside my app extension to block it in the case of shielding an app the situation is that i need the applicationToken which i tried to get from the Application object and transfer it to my app extension threw NSUserDefaults with no success. it seems that applicationToken value is unreachable and nil when i create an Application object. after this i tried to get an applicationToken of a selected app from the familyActivityPicker and i had success and managed to shield the app i selected. i did all of this on a child device only in a parent device the familyActivityPicker shows only categories and i cant figure out how the connection to the child apps in order to block or shield them will be made my questions are: is it possible to get applicationTokens not from the familyActivityPicker? how the parent app suppose to block an app on the child app without having any apps showing? how a parent app is "talking" with the child app exactly?
0
0
1.1k
Nov ’21
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
FamilyControlsError Code=2 on Parent's Device
I have tried to use Screen Time API. The problem is that I can't get access to FamilyControl framework on parent's device. What should I do to get access? class AppDelegate: NSObject, UIApplicationDelegate {        func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {         AuthorizationCenter.shared.requestAuthorization { res in             switch res {             case .success():                 print("===SUCCESS AUTHORIZATION===")             case .failure(let error):                 print(error.localizedDescription)             }         }         return true     } }
1
0
1.2k
Oct ’21
2 screen time bugs (im 13 dont judge)
So 2 bugs i have been finding with the screen time that really annoy me is that 1. why does the screen time on my phone go even when im not using it! My parent has set an hour on my phone every day and that hour goes while im at school and the timer should stop when i turn my phone off. And the 2nd thing is how do i fix my phone to turn off the screen time when changes have been made and they are not applying. My parent has turned off screen time and yet it is still on my phone and on the parents phone it says its disabled.
0
0
452
Oct ’21
Shielding Specific Contacts via Screen Time Communication Limits
Hello, Thank you Chris & Nolan for the wonderful Screen Time API demo! I would like to apply this new functionality to limit a child's communication with a specific contact selected by a parent during, "Homework" hours. I would like to configure the shield to ONLY restrict the chat log of the specified contact, not the entire Messages application. At the end of "Homework" hours I would like the child to be able to view any missed messages or calls they received, while this contact was restricted. It does not appear that a parent can specify communication limits within managed settings without using lockCellularPlan or shielding the entire app with the familyactivitypicker. Can we configure downtime restrictions using this API? If you could point me to the correct part of the framework so I can further investigate how to implement this, that would be very helpful. Thank you!
Replies
0
Boosts
0
Views
1.3k
Activity
Feb ’22
Blocking an app that is not available on appStore
Does screen time api blocks an app if it is not available on the app store anymore but it is still installed on a child device?
Replies
0
Boosts
0
Views
978
Activity
Feb ’22
Can I get code examples of Homework app that was shown on WWDC21?
Hello, Apple! Thanks for sharing Screen Time API! Together with my team we want to develop one cool app, that is based on parent-child relationship. Unfortunately, we couldn't understand completely how Screen Time API works according documentations. Could you please provide us a code example of Homework demo app or maybe guid us on what kind of steps we must do in order to get next functionalities: Block apps on child device until parent allow to access them. Listen what apps are running on child device. We need integrate backend part that way that child will be able to deserve by his own ability to use other apps for some time. Is it possible to make such functionality in background? Looking forward for your response! Best regards Dmitriy
Replies
4
Boosts
0
Views
3.9k
Activity
Feb ’22
We are Facing when we are enable Family Control Restrictions.
Connection error from Optional("com.apple.FamilyControlsAgent"): Couldn’t communicate with a helper application.
Replies
1
Boosts
0
Views
1.3k
Activity
Jan ’22
Is it possible to request FamilyControls authorization on simulator?
I'm getting a FamilyControlsError Code=3 when requesting authorization from a simulator signed in with a child iCloud account. When requesting authorization from a simulator signed in with a parent iCloud account I receive the expected FamilyControlsError Code=2. There's not a lot of info on resolving these errors, and the code is pretty simple: func requestAuthorization() {     AuthorizationCenter.shared.requestAuthorization { result in         switch result {         case .success():             print("Sucess...")         case .failure(let error):             print("Failed... \(error)")         }     } }
Replies
8
Boosts
0
Views
3.5k
Activity
Jan ’22
blocking and shielding on separate apps
is blocking and shielding can be done when the case is 2 completely separate apps one for the parent and one for the child and not one app that have 2 types of users (parent and child)?
Replies
0
Boosts
0
Views
840
Activity
Jan ’22
Event threshold callbacks are inconsistent
The event threshold callbacks are inconsistent. We receive the callback 30mins to 1hour late after scheduling or it stops coming suddenly. Is there any limit how many callbacks will be coming per hour or day? Sometimes I don't get the callback at all. Sometimes it works properly for the whole day(Same code without any change). Additional note: Sometimes I don't receive the schedule start call-back but the event threshold.
Replies
1
Boosts
0
Views
1.2k
Activity
Jan ’22
How does child can unblock apps for some period of time using Screen Time API?
I have created the app that uses Screen Time API (Device Activity, Managed Settings and Family Control). I have allowed on child device block and unblock apps that are selected in familyPicker, but I have to add ability to unblock these apps for some period of time. I have tried this:             do {                     center.stopMonitoring()                     try center.startMonitoring(.unblock, during: schedule, events: [.encouraged: DeviceActivityEvent(                         applications: applications.applicationTokens,                         threshold: DateComponents(second: 30)                     )])                     print("Unblock apps")                 } catch {                     print("Error")                 } Maybe I have to use another way to do it? but this doesn't work for me.
Replies
1
Boosts
0
Views
1.2k
Activity
Jan ’22
how can i have separate thresholds for different apps i selected?
i managed to shield app according to selection from the picker on the child app. i noticed that the threshold is for all the usage time of al the apps combined together. that means that if the threshold is 10 minutes and i used one of the selected apps 5 minutes and the other one for 5 minutes they both will be blocked. what i'm trying to do is that if each an app reached the threshold only it will be shielded anyone knows how to to this?
Replies
2
Boosts
0
Views
911
Activity
Nov ’21
Screen Time API FamilyActivityPicker
There are 2 types of login in the application one for Parents and one for Children. Once the parent has signed up and set his profile, then he will be able to add multiple students. Students will be able to log in to the app using the QA code provided by the parent. Once the students have logged in successfully, the Parent can set their restrictions that which applications to be restricted for use. The parent can add scheduled prompts for specific students in terms of hourly, daily, weekly, and monthly. Once the scheduled prompt arrives on the student’s device in terms of notification. The student's device-restricted apps will be locked for a specific amount of time. The student is allowed to complete a subject questionnaire to unlock their device. For eg, there will be a list of 5 questions with multiple options to choose from. If the student gives a minimum of 4 right answers the student’s device will be unlocked or it will be locked for 5 minutes if the count of the correct answers is less than 4. After the 5 minutes [Specific time - predefined] are complete, the student's device will be unlocked. We also created Apple ID for parents and children from family sharing documentation for screen time API. We also implemented authentication functionality with help of the family controls framework after approval we called FamilyActivityPicker as per provided document on family controls we got a view of all categories list but we were unable to see the application list on which depending on their category How we lock all applications depending on he got remote notification in student device  Mac OS:- Bigsur (11.4) System:- Mac mini(M1,2020) Chip:- Apple M1 Memory:- 16GB XCode:- 13
Replies
1
Boosts
0
Views
1k
Activity
Nov ’21
How does a guardian access home control information for a child's device
I use Screen Time Api to authorized the app in child's phone,but I can't get child's home control information
Replies
0
Boosts
0
Views
618
Activity
Nov ’21
Not getting call back to DeviceActivityMonitor extension
Hi, Problem: Even after successful schedule creation I am not getting call backs(intervalDidStart, intervalDidEnd) to my extension I have created DeviceActivityMonitor extension by creating call Directory Extension and updated info plist with the value (com.apple.deviceactivity.monitor-extension) and updated principal class value too. I try running the extension on my demo app which has the below code,         let schedule = DeviceActivitySchedule(             intervalStart: DateComponents(hour: 10, minute: 30),             intervalEnd: DateComponents(hour: 12, minute: 15),             repeats: true,             warningTime: nil)         do {             let center = DeviceActivityCenter()             center.stopMonitoring([.daily])             try center.startMonitoring(.daily, during: schedule)             print("Schedule created")             print(center.activities)         } catch {             print(error)         }     } My extension has the below code, override func intervalDidStart(for activity: DeviceActivityName) {         super.intervalDidStart(for: activity)         print("Entered Did Start")     }     override func intervalDidEnd(for activity: DeviceActivityName) {         super.intervalDidEnd(for: activity)         print("Entered Did End")     } Please guide me to find out the issue. Thanks in advance.
Replies
2
Boosts
0
Views
2.1k
Activity
Nov ’21
I can't access the kid's device control data through ScreenTimeApi
I authorized the kid-side device, and the kid-side device can get the corresponding data and control through familyActivityPicker. However, the parent side cannot get the kid-side control data, even though we are already in the same family group
Replies
0
Boosts
0
Views
813
Activity
Nov ’21
define a family without a parent
is it possible to define only a child on a family in order to get authorization for the screen time api or a parent is mandatory?
Replies
0
Boosts
0
Views
783
Activity
Nov ’21
Screen Time Usage History
With the new iOS 15 screen time API, is it possible to get the usage history of apps or app categories? Like instead of just tracking the current usage within your newly added schedule, is there a way to see the average time spent on your phone for the past week/month/year like you can in settings?
Replies
1
Boosts
0
Views
1.4k
Activity
Nov ’21
applications and applicationTokens
in order to block an app i need to have a bundle identifier for the app i want to block and then pass it to the Application constructor like this: Application(bundleIdentifier: "com.apple.calculator") then i can use it inside my app extension to block it in the case of shielding an app the situation is that i need the applicationToken which i tried to get from the Application object and transfer it to my app extension threw NSUserDefaults with no success. it seems that applicationToken value is unreachable and nil when i create an Application object. after this i tried to get an applicationToken of a selected app from the familyActivityPicker and i had success and managed to shield the app i selected. i did all of this on a child device only in a parent device the familyActivityPicker shows only categories and i cant figure out how the connection to the child apps in order to block or shield them will be made my questions are: is it possible to get applicationTokens not from the familyActivityPicker? how the parent app suppose to block an app on the child app without having any apps showing? how a parent app is "talking" with the child app exactly?
Replies
0
Boosts
0
Views
1.1k
Activity
Nov ’21
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
FamilyControlsError Code=2 on Parent's Device
I have tried to use Screen Time API. The problem is that I can't get access to FamilyControl framework on parent's device. What should I do to get access? class AppDelegate: NSObject, UIApplicationDelegate {        func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {         AuthorizationCenter.shared.requestAuthorization { res in             switch res {             case .success():                 print("===SUCCESS AUTHORIZATION===")             case .failure(let error):                 print(error.localizedDescription)             }         }         return true     } }
Replies
1
Boosts
0
Views
1.2k
Activity
Oct ’21
2 screen time bugs (im 13 dont judge)
So 2 bugs i have been finding with the screen time that really annoy me is that 1. why does the screen time on my phone go even when im not using it! My parent has set an hour on my phone every day and that hour goes while im at school and the timer should stop when i turn my phone off. And the 2nd thing is how do i fix my phone to turn off the screen time when changes have been made and they are not applying. My parent has turned off screen time and yet it is still on my phone and on the parents phone it says its disabled.
Replies
0
Boosts
0
Views
452
Activity
Oct ’21
Unable to see list of child's application in Family Activity Picker
Hi, In child's app I could successfully get list of applications in Family Activity Picker after Parental authorisation but I couldn't get list of child's applications from the parent app.
Replies
0
Boosts
0
Views
659
Activity
Oct ’21