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.