Post not yet marked as solved
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?
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
Post not yet marked as solved
Connection error from Optional("com.apple.FamilyControlsAgent"): Couldn’t communicate with a helper application.
Post not yet marked as solved
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)")
}
}
}
Post not yet marked as solved
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)?
Post not yet marked as solved
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.
Post not yet marked as solved
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.
Post not yet marked as solved
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?
Post not yet marked as solved
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
Post not yet marked as solved
I use Screen Time Api to authorized the app in child's phone,but I can't get child's home control information
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.
Post not yet marked as solved
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
Post not yet marked as solved
Can you please make the sample code for the screen time api available?
Post not yet marked as solved
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?
Post not yet marked as solved
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?
Post not yet marked as solved
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?
Post not yet marked as solved
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.
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
}
}
Post not yet marked as solved
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.
Post not yet marked as solved
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.