Using the Screen Time API, I can create multiple ManagedSettingStore objects with different names. Is there a way to retrieve these later by name?
For example, if I create them dynamically from a configuration managed by the user of my app, and the app crashes or its data gets corrupted, how can I get rid of "stale" ManagedSettingStore objects that I no longer know?
Or, if I somehow lose the name of a ManagedSettingStore I created, how long does the store stay active? Forever? How can I get rid of the "stale" store?
Family Controls
RSS for tagPrevent access to the Screen Time API without guardian approval and provide opaque tokens that represent apps and websites.
Posts under Family Controls tag
185 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
I have recently noticed that ever since I downloaded iOS 18 Public Beta 1, I have been unable to get to the screen time settings, after clicking the tab, the app just freezes. Although after a while I did get to the Screen Time tab, but all of the previous changes to my screen time were voided. App limits, Downtime, you name it, all gone. While my app limits do not work, I noticed that downtime still functioned, but when my parent changed the downtime settings on their phone (running iOS 17 no betas), it did nothing on my end. I am currently submitting feedback to apple and am trying to find workarounds. On an unrelated note to this issue, I noticed that “One More Minute” and “Request More Time” aren‘t there anymore, does anybody have any ideas or workarounds on any of these?
This morning I downloaded iPad/iPhone OS 18 public beta and I went to send a request for youtube and I can’t. the only option that comes up when I press ask for more time is enter screen time passcode. TIA
"Hi everyone! We've encountered an issue with uploading our app to the App Store. We received the Family Controls Distribution permission, updated the certificates and profiles, submitted it for review, but received feedback that the request simply doesn't appear for the moderators. Does anyone know what the problem might be? Our request is: try await center.requestAuthorization(for: .individual). We also confirmed that the device must have TouchID or FaceID installed."
I am using Screen Time with "Block Limited Websites." For the most part it works, but...
Despite putting "Frame.io" and "api.apple-cloudkit.com" repeatedly in the "Approved" list, a message still appears showing that it is blocked. Please fix or show a resolution. Thank you!
I am working on a project that uses the FamilyActivityPicker from family controls. When I run it on the xcode simulator I can see the different categories of apps, but no specific apps. However, when I run the project on my phone I can see my apps. Is there a way to get this to work on simulator, as I would prefer to not have to download my project on my phone every time I want to test it. Many thanks!
I know it said that the device activity report extension data cannot be extract but what about importing data to the report ?
Certain entitlements require special permission from Apple like DriverKit or Screentime API/Family controls.
Those entitlements are tied to the bundle IDs of the app.
If those entitlements have been granted for an app from developer A (personal account) and we transfer that app to developer B (organization account), including the bundle IDs, will those bundle IDs keep the entitlement?
Or will we need to re-request from the developer account B?
Any insights or experiences regarding this process would be greatly appreciated.
What is the proper use case of blockedApplications in the Screen Time API? I seem to be using it exactly as the documentation describes, however it is being rejected from the App Store. I am passing in bundle identifiers to block/hide the applications from the device.
What would be the proper way to use blockedApplications? Or is there a way to use it at all in an app being submitted for review?
Thanks!
Hi, I'm having an issue where I'm trying to sort the applications related to the FamilyActivityPicker in the FamilyControls library. I'm able to populate a List in SwiftUI and able to see that a token is associated, but in general, there's no comparable to sort the Set which I converted into an array. Any help is appreciated!
⬇️ ANYONE ON APPLE'S SCREEN TIME TEAM, PLEASE READ THIS ⬇️
Let's summarize the situation.
3rd-party apps with screen time access can be disabled by going to Settings > Screen Time > Apps with Screen Time Access. That's fine.
Now, if I want to make it harder to remove my restrictions, I can ask a friend to enter a Screen Time Passcode for me. Great idea!
The problem is my Screen Time Passcode isn't requested when disabling permissions for a third-party app. It's required for modifying any other Screen Time setting EXCEPT permissions for 3rd party apps.
This is frustrating. The Screen Time passcode is a great feature. Making it compatible with permissions granted through the Family Controls framework is our NUMBER ONE REQUEST from tens of thousands of users.
This feature has been requested for a long time (iOS 16, iOS 17, …):
https://forums.developer.apple.com/forums/thread/714651
https://forums.developer.apple.com/forums/thread/727291
https://discussions.apple.com/thread/255421819
FB13548526
If you're a developer working on Screen Time, share your feedback below or file one using Feedback Assistant.
It is very disappointing to see it wasn't implemented for iOS 18. I can't believe this would require tremendous work from the Screen Time team to make it happen, but it would be a significant improvement for the Family Controls Framework and a ray of sunshine for all the developers who have worked really hard to deliver high-quality apps using the Screen Time API.
Could an Apple engineer or a Screen Time team member give us any updates? Implementing this before the public release of iOS 18 would make A LOT of developers happy.
Some of our users encounter an issue after updating their iPhone/iPad to iOS 17.5.1.
The tokens passed in the Shield Configuration extension don't match the tokens they selected in my app using the FamilyPicker before updating to iOS 17.5.1. It seems the tokens changed for no reason. My app can't match the token from the ShieldConfigurationDataSource to any tokens stored on my end, causing my shield screens to turn blank. The same applies to tokens in the Device Activity Report extension.
The only workaround I've found is to tell affected users to unselect and reselect apps and websites to block in my app. This gets them new tokens from the FamilyActivityPicker, which solves the issue. However, for some users, the bug reoccurs a few days later. Tokens seem to change again, causing the same issue in the Shield Configuration extension.
I am not able to reproduce the issue on my test devices so I have no sysdiagnose to attach. However, this issue is affecting other screen time apps:
https://developer.apple.com/forums/thread/732845
https://forums.developer.apple.com/forums/thread/756440
FB14082790
FB14111223
A change in iOS 17.5.1 must have triggered this behaviour. Could an Apple engineer give us any updates on this?
Since iOS 18 Seed 2, I've noticed an issue. When calling startMonitoring(_:during:events:) with an already monitored activity, intervalDidStart in the Device Activity Monitor extension isn't triggered as it should be.
I have to manually call stopMonitoring(_:) BEFORE restarting the activity for intervalDidStart to be called. This is 100% reproducible.
This is different from how it worked before iOS 18 Seed 2 and contradicts the official documentation, which says, “If the app already monitored the activity, this method overwrites the previous schedule and events.” IMO, this suggests we shouldn't have to stop the activity manually; the startMonitoring(_:during:events:) method should handle it automatically.
Is this a mistake or intended behavior?
If intended:
Could you give us the reason?
The documentation should be updated to reflect this change.
I've already filed a feedback about this issue (FB14110789).
Hello,
I am working on an app that schedules a device activity monitor from the screen time API.
I noticed that sometimes scheduling an activity monitor won’t work and instead I see this log:
Canceling request to […].DeviceActivityMonitorExtension because it exceeded its allowed time.
What does this mean? What exactly is exceeding its allowed time?
Would love to get some feedback on this so I can prevent this from happening.
Thanks a lot for any help and have a nice day!
Hi, I uses to have the Time management for my Kids. Since my kid is using the bêta version of ios 18, Time management is not working anymore. He can use the iPhone without any restrictions … what can I do?
The following is request authorization for familyControls:
AuthorizationCenter.shared.requestAuthorization { result in
// The request can either result in success or failure
switch result {
case .success():
break
case .failure(let error):
print("Error for Family Controls: (error.localizedDescription)")
}
}
But the output is"Error for Family Controls: Family Controls is only available for child and teen iCloud accounts."
I have added the "Family Controls" capability, How do I use "Family Controls"
The listening callbacks were not triggered for intervalDidStart and intervalDidEnd after successfully starting center.startMonitoring when I attempted to set a schedule with DeviceActivitySchedule at 20-minute intervals
Is there anyone who can assist me? Thank you.
Below you will find my code.
let intervalLengthInSeconds = 20 * 60
let intervalEnd = Date(timeIntervalSinceNow: TimeInterval(intervalLengthInSeconds))
let intervalStart = Date()
let schedule = DeviceActivitySchedule(intervalStart: Calendar.current.dateComponents([.hour, .minute], from: intervalStart),
intervalEnd: Calendar.current.dateComponents([.hour, .minute], from: intervalEnd),
repeats: false,
warningTime: DateComponents(minute: 1))
let newActivity = DeviceActivityName(rawValue: "20minuteUse")
Log("😯 \(String(describing: schedule.nextInterval))")
do {
try center.startMonitoring(newActivity, during: schedule)
} catch {
print("failed to start session: \(error.localizedDescription)")
}
class MyMonitorExtension: DeviceActivityMonitor {
let store = ManagedSettingsStore()
// You can use the `store` property to shield apps when an interval starts, ends, or meets a threshold.
override func intervalDidStart(for activity: DeviceActivityName) {
super.intervalDidStart(for: activity)
// Shield selected applications.
Log("😓 start-------")
}
override func intervalDidEnd(for activity: DeviceActivityName) {
super.intervalDidEnd(for: activity)
Log("😓 end-------")
}
override func intervalWillStartWarning(for activity: DeviceActivityName) {
super.intervalWillStartWarning(for: activity)
Log("😓 StartWarning-------")
}
override func intervalWillEndWarning(for activity: DeviceActivityName) {
super.intervalWillEndWarning(for: activity)
Log("😓 EndWarning-------")
}
}
schedule.nextInterval ------ print:
😯 Optional(2024-06-21 08:34:00 +0000 to 2024-06-21 08:54:00 +0000)
let schedule = DeviceActivitySchedule(
intervalStart: DateComponents(calendar: Calendar.current ,hour: 20, minute: 0), intervalEnd: DateComponents(calendar: Calendar.current ,hour: 22, minute: 59), repeats: true, warningTime: nil
)
store.shield.applications = selectionToDiscourage.applicationTokens.isEmpty ? nil : selectionToDiscourage.applicationTokens
store.shield.applicationCategories = selectionToDiscourage.categoryTokens.isEmpty ? nil : ShieldSettings.ActivityCategoryPolicy.specific(selectionToDiscourage.categoryTokens)
store.shield.webDomains = selectionToDiscourage.webDomainTokens
store.application.blockedApplications = selectionToDiscourage.applications
try center.startMonitoring(.daily, during: schedule)
try center.startMonitoring(.daily, during: schedule)
let schedule = DeviceActivitySchedule(
intervalStart: DateComponents(calendar: Calendar.current ,hour: 20, minute: 0), intervalEnd: DateComponents(calendar: Calendar.current ,hour: 22, minute: 59), repeats: true, warningTime: nil
)
extension DeviceActivityName {
static let daily = Self("daily")
}
So I updated my phone to ios18 beta and ever since then my phone will always crash when I enter screen time but any other application nothing will happen, my phone has gotten so much slower and heats up faster. Lags so much! I dont know what else to do. I have 107gb and my max is 128gb so I don’t see that as the issue. Especially since I can’t enter into my screen time. I waited it out for almost two or one week. it hasn’t changed. restarted my phone and everything. please help asap!!!