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
Replies
Boosts
Views
Activity
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
}
}
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