Family Controls

RSS for tag

Prevent access to the Screen Time API without guardian approval and provide opaque tokens that represent apps and websites.

Posts under Family Controls tag

176 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

[iOS 18] Screen Time Passcode is still NOT compatible with screen time permissions for 3rd party-apps
⬇️ 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.
3
4
137
1d
Tokens change without reason after updating to iOS 17.5.1
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?
1
1
88
4d
[iOS 18 Beta 2] Already monitored device activities need to be manually stopped before being restarted
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).
0
1
105
4d
Canceling request to […].DeviceActivityMonitorExtension because it exceeded its allowed time.
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!
0
1
97
6d
How do I use the FamilyControls
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"
2
0
114
1d
The DeviceActivityMonitor did not trigger a callback
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)
2
0
109
1d
Screen Time | How to enable/disable screen time for a game app by setting start and end times?
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)
0
0
78
1w
Screen Time | How to enable/disable screen time for a game app by setting start and end times?
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") }
1
0
89
1d
Screen time crashing
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!!!
3
3
222
1w
How to show icons apps when retrieving DeviceActivityReport
Actually, I'm developing a new app based on screen time API, so I implemented my report device extension like this struct TotalActivityReport: DeviceActivityReportScene { // Define which context your scene will represent. let context: DeviceActivityReport.Context = .totalActivity // Define the custom configuration and the resulting view for this report. let content: (ActivityReport) -> TotalActivityView func makeConfiguration(representing data: DeviceActivityResults<DeviceActivityData>) async -> ActivityReport { // Reformat the data into a configuration that can be used to create // the report's view. var res = "" var list: [AppDeviceActivity] = [] let totalActivityDuration = await data.flatMap { $0.activitySegments }.reduce(0, { $0 + $1.totalActivityDuration }) for await d in data { res += d.user.appleID!.debugDescription res += d.lastUpdatedDate.description for await a in d.activitySegments{ res += a.totalActivityDuration.formatted() for await c in a.categories { for await ap in c.applications { let appName = (ap.application.localizedDisplayName ?? "nil") let bundle = (ap.application.bundleIdentifier ?? "nil") let duration = ap.totalActivityDuration let numberOfPickups = ap.numberOfPickups let token = ap.application.token let app = AppDeviceActivity( id: bundle, displayName: appName, duration: duration, numberOfPickups: numberOfPickups, token: token ) list.append(app) } } } } return ActivityReport(totalDuration: totalActivityDuration, apps: list) } } Then TotalActivityView to visualize returned data like this // // TotalActivityView.swift // DemoScreenTimeReporter // // Created by Achraf Trabelsi on 17/06/2024. // import SwiftUI import ManagedSettings struct TotalActivityView: View { var activityReport: ActivityReport var body: some View { VStack { Spacer(minLength: 50) Text("Total Screen Time") Spacer(minLength: 10) Text(activityReport.totalDuration.stringFromTimeInterval()) List(activityReport.apps) { app in ListRow(eachApp: app) } } } } struct ListRow: View { var eachApp: AppDeviceActivity var body: some View { HStack { Text(eachApp.displayName) Spacer() Text(eachApp.id) Spacer() Text("\(eachApp.numberOfPickups)") Spacer() Text(String(eachApp.duration.formatted())) if let appToken = eachApp.token { Label(appToken).labelStyle(.iconOnly) } } } } But I got this issue : Cannot convert value of type 'ApplicationToken' (aka 'Token') to expected argument type 'LabelStyleConfiguration' So if anyone have an idea, how can we get application icons please ?
0
0
134
2w
Apps of the same family being blocked inadvertently
My app allows users to select apps and websites to block using the Screen Time API. Lately I have gotten a bunch of emails from users who say that selecting one app also results in other apps of that family being blocked, even if they aren't selected in the FamilyActivityPicker. The most common example is Facebook. A handful of users have said that they selected Facebook to be blocked, but Messenger will be blocked as well (even though Messenger isn't selected, and they don't want it to be blocked). Does anyone know why this might be happening? It seemed to begin happening awhile ago after allowing users to block websites in addition to apps - not sure if that could have something to do with it.
3
1
143
2w
Screen Time Crash. IOS 18 Dev Beta 1
I have experienced a consistent bug with screen time in IOS 18 DB1. It just doesn’t work, but the limits still function. I cannot access screen time settings (it just crashes) nor can I disable screen time from within a blocked app itself. Have not found any workaround. I have logged a feedback report, FB13932765 (Unable to open screen time settings, it just crashes) I Hope this can be looked at and resolved by the next update. Thanks, Felix
7
13
839
2d
Inconsistency in the DeviceActivityEvent callbacks
We are using the Apple ScreenTime API for monitoring the usage of device. As mentioned in the documentation (https://developer.apple.com/documentation/familycontrols), we are getting the family controls authorisation from the user. We also have added the ‘DeviceActivityMonitor’ app extension (https://developer.apple.com/documentation/deviceactivity/deviceactivitymonitor) to receive the schedule and event callbacks. We have a requirement in which we have to notify the user for every 15 minutes usage of the device in the specified interval. He can optionally select individual categories or applications for the 15 minutes notification. For monitoring the usage for individual categories or applications, we obtain the token by presenting the FamilyActivityPicker as discussed in this documentation https://developer.apple.com/documentation/familycontrols/familyactivitypicker. For simplicity in testing during the development phase, we reduced the 15 minutes to 2 minutes. The events callbacks are expected to be delivered as soon as the threshold is reached but there are some inconsistencies with the event threshold callbacks. Sometimes the event callbacks are deferred and delivered together, sometimes the event callbacks are not delivered at all, sometimes a few event callbacks are missed etc.
0
1
155
2w
Usage time tracking is being killed by jetsam
Brief & History Since iOS 17.4 and up we experience a lot of flakyness when it comes to DeviceActivity event thresholds. After a lot of testing and investigations inside system logs and filing countless bug reports we found a reproducible way why the event thresholds are not getting properly called. Findings Apparently when the device reaches near to max memory something called jetsamkills processes left and right. This means that the UsageTrackingAgent that (we think) is responsible for tracking the usage time of the device gets killed and doesn't recover until significant memory is freeing up on the device. How to test it yourself Use a slightly older device with ~ 3 or 4 GB of RAM Open a game or two that is meomry intensive (like Fishing Clash, yes..) and observe In the console logs you see something that only happens then: Process UsageTrackingAgent [39307] killed by jetsam reason highwater This happens often but recovers itself when the UsageTrackingAgent exceeds their 6MB memory limit. Yet the log looks like this: Process UsageTrackingAgent [39307] killed by jetsam reason per-process limit Once you kick the game, the memory is free and sometimes the event thresholds are calling in again. Defeating the purpose However this defeats the purpose of tracking usage time and shielding perhaps the playing app from being played after a certain amount of time! Feedback Assistant Ticket Here is the ticket with sysdiagnose, step by step and more information: FB13884981 Please fix this ASAP, this is such a pain for production users and their kids EVERY DAY.
1
5
294
2w
Can I export app usage data(Device Activity framework) to an external database
Hello, I want to make an app purely for academia to get the app usage data which includes timestamps of app usage and I want to store this data in a MySQL database for analysis purposes. From what I have read online, I don't get access to the raw data instead I can only see the data in Views. Is there any way I can export this data outside the app? Is it even possible?
2
0
182
3w
Screentime API new issues on iOS 17.4.1 and 17.5.1
Hi, I have a released screentime app ScreenZen. The last few days I've seen a disturbing spike in bug reports coming from people with 17.4.1 and 17.5.1 phones with no update to the app itself. People reported they saw the issue immediately after updating their iOS version. Unfortunately it is not replicable on all phones with those versions, so we haven't been able to replicate it on our test phones. It appears the issue is the ApplicationToken passed into ShieldActionExtension and ShieldConfigurationExtension does not match any of the ApplicationTokens that the user selected to block through FamilyControls. (The selected ApplicationTokens are being loaded through a group UserDefaults and they are indeed being loaded in the ShieldActionExtension in the bug reports).This is preventing the app from loading the correct settings and handling the blocking accordingly. I am trying to isolate this better with a new release with better logging, but would appreciate any help on this issue.
1
4
433
6d
FamilyActivityPicker Questions
I have a couple of questions on the FamilyActivityPicker that I couldn't seem to find in the documentation: Is there any way to have it show only apps or websites? I've had some users reach out with frustrations because they want to select a category of apps (e.g. "Social"), but that also selects a lot of websites that they don't want to include. Where does the picker get the websites that it populates? It seems like there's not much rhyme or reason to these (and there's often multiple urls for the same site - e.g. facebook.com and m.facebook.com). Is there any way (as a developer) to have preset app selections available upon download? For example, can I have an option that has certain apps in the Social category chosen by default so that each user doesn't have to go in and manually select all of the apps they want?
1
0
261
May ’24