Is the Screen Time API completely broken in the betas?

I've been trying to get something to work with the Screen Time API, but almost everything related to it is completely and truly broken/unimplemented. I've tried all of this in the iOS 15 Beta 2 and 3 and Xcode 13 Beta 2 and 3.

These are just a handful of the bugs I came across:

  • Screen Time APIs do not work on the simulator. Calling AuthorizationCenter.shared.requestAuthorization on a simulator with a logged in child account always results in "FamilyControls.FamilyControlsError Code=3"

  • FamilyActivityPicker does not list installed apps on either of the guardian's or child's devices, it only lists the categories. It's not clear at this point whether FamilyActivityPicker needs to be called on the parent or the child device.

  • Assuming restrictions can actually be set, there is no API to allow setting up of restrictions for individual kids.

  • After successfully authorizing a child device via AuthorizationCenter.shared.requestAuthorization, DeviceActivityCenter.startMonitoring always results in an MonitoringError.unauthorized error.

  • AuthorizationCenter.requestAuthorization error in callback cannot be mapped back to FamilyControlsError because it is a plain NSError with an error code and FamilyControlsError does not expose an initialiser that takes a rawValue.

  • Even though an app is authorized to managed ScreenTime on a child device, the child can always just delete the app. (I would try to submit a bug with device diagnostics about this using Feedback Assistant, but to top it all off at the moment I am receiving an error in FA that says "Unable to gather diagnostics" / "A problem was encountered when trying to gather diagnostics. Try gathering diagnostics again").

  • There's no device activity / shield configuration or shield action extension templates in Xcode. For those wondering, I created a CallDirectory extension and then changed the NSExtensionPointIdentifier in the plist to the appropriate value. What is the appropriate value? It's not mentioned in the documentation :), so I had to dig around in the Xcode support files to find out the following identifiers:

com.apple.ManagedSettings.shield-action-service
com.apple.ManagedSettingsUI.shield-configuration-service
com.apple.deviceactivity.monitor-extension
  • And this leads me to my last item: the documentation which is absolutely lacking. There is no programming guide for the frameworks and the Homework app we saw developed during WWDC is not available. It's not clear how the settings from the guardian app get applied to the child app. Is there a built-in mechanism or do we need to use our own implementation to transfer those changes (via push or whatever)?

Of course I reported almost all of this via Feedback Assistant, but considering I had previous feedback for other APIs sit there untouched for years in the past, it's really frustrating and it feels like I'm just talking to myself with those bug reports.

So, did I do something wrong and completely misinterpreted the capabilities and functionality of the ScreenTime API or is it truly broken and non-functional in iOS 15 Beta 2/3?

There's absolutely no mention of these issues in the release notes so I am starting to question my sanity here.

I'm facing all the issues you mentioned here. Also reported them through the Feedback Assistant.

I'm a bit surprised Apple decided to release this API which clearly is not yet ready for third-party developers.

Same here, I'm facing all the issues too. I was also starting to question my sanity

I am also facing the same error at the time of DeviceActivityCenter.startMonitoring

DeviceActivityCenter.startMonitoring always results in an MonitoringError.unauthorized error.

While filing a radar (feedback assistant post nowadays) I've came across the following console log from the system at the time of request to start monitoring.

rejecting read of { com.apple.CloudKit, mobile, kCFPreferencesAnyHost, /var/mobile/Library/Preferences/com.apple.CloudKit.plist, managed: 0 } from process 1083 (FamilyControlsAgent) because accessing these preferences requires user-preference-read or file-read-data sandbox access

Couldn't read values in CFPrefsPlistSource<0x143018430> (Domain: com.apple.CloudKit, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: Yes): accessing these preferences requires user-preference-read or file-read-data sandbox access

Maybe some capability they didn't document is missing here, hope the next beta version lands soon and fixes it.

I've summarized some questions for Apple's intentions in this forum post as well and attached some radars.

Go check it out and upvote please! https://developer.apple.com/forums/thread/685498

Same here, I've also tried all of this in the iOS 15 Beta 2 and 3 and Xcode 13 Beta 2 and 3 and I'm facing all these issues that you've maintained here. Waiting for a reply from Apple.

Apple has fixed some of these issues. Try again after erasing and installing (not updating) a device to the most recent beta. If you still experience problems please report them, with details and logs, via Feedback Assistant.

FamilyActivityPicker does not list installed apps on either of the guardian's or child's devices, it only lists the categories. It's not clear at this point whether FamilyActivityPicker needs to be called on the parent or the child device.

The apps are now shown in the app running on the child device. They are not shown on the parent device.

After successfully authorizing a child device via AuthorizationCenter.shared.requestAuthorization, DeviceActivityCenter.startMonitoring always results in an MonitoringError.unauthorized error.

This appears to have been fixed.

Even though an app is authorized to managed ScreenTime on a child device, the child can always just delete the app.

This is fixed, parental sign-in is now required to delete the app.

The DeviceActivityMonitor extension is launched at the start of the interval, so that's good as well.

But there's still the critical issue where the parent app cannot list and set restricted apps installed on the child device. I'm still wondering whether the parent app is responsible for transferring restriction information via its own transport (pushes?) or is there a built in mechanism to push the app selection to the child app. If that's the case, the child could just disable pushes for the app and he won't receive restriction updates any more.

Another thing that's bugging me is that the FamilyActivityPicker is accessible on the child device without requiring authorization after it's been authorized once. As it stands now, the child could just update the selection and uncheck everything. I'll report this via Feedback Assistant.

I'm still not seeing the extension types/templates in Xcode 13 beta 4. Is the answer still to create the extensions manually?

No the FamilyActivityPicker does not include "All Apps & Categories" anymore..

Feedback Report: FB9421632

i have created an extension and changed the identifier to com.apple.deviceactivity.monitor-extension i subclassed DeviceActivityMonitor in my class and designated it as the principal class of my app extension but non of the methods doesn't get called when trying to monitor an activity

  1. what method will trigger the extension? is it center.startMonitoring(activity, during: schedule) in that case why non of my extension DeviceActivityMonitor methods doesn't gets called?

  2. why calling requestAuthorization on parent device always fails?

  3. can anyone upload some sample code that actually do something?

Hi,

I too faced the problem, one of my friend suggested to debug extension process and check console which helped. I received the call back to the code and while observing console logs expected events fired for start and end.

Raised this thread too - https://developer.apple.com/forums/thread/689460

Console logs under the process 'DeviceActivityMonitorExtension' below,

Interval started for daily

Interval ended for daily

Hope this will help.

Update 13 Oct 2021 iOS 15.1 (19B5042h) and 15.1 beta 3 (19B5060d):

The Screen Time API still appears to be bugged out of its mind. I am not able to consistently list the applications from the child devices on the guardian device. It worked at one point for one child device with iOS 15.1 (19B5042h), meaning I was able to see the apps from the child device on the guardian device, but in my setup I had two child devices and I wasn't able to see and list the apps from the second one. I contacted Apple DTS and this is what they had to say:

Q: How would I go about seeing and managing apps from the second device? I also tried factory resetting the second child device and re-authorizing, but the apps never showed up on the parent device, even after cold starting the app. Is there a way to choose between the devices/accounts available to manage via FamilyControls?

A: There is no way to choose. All I can suggest is try de-authorizing both child devices and the guardian device, making sure all are enrolled in the same iCloud Family, and the child accounts are under 14 years old, and both have ScreenTime enabled. Make sure the guardian device can see the child devices in ScreenTIme. Then try again. If apps from both devices still don’t show up on the guardian device, then please file a bug report with sysdiagnose logs from all devices, so our engineers have the data they need to start investigating

I submitted the bug report FB9700146 with attached sysdiagnose logs from all the devices, but I'm not optimistic about this.

I'm having the same issue with iOS 15.1.

I'm implementing the screen time API and restricting apps on the child's device. However, I did not receive the shield once the period of a certain app had expired.

Also, I didn't see a kid device's apps restriction for selection by familyActivityPicker on the parent device.

Please provide the assistance that is required.

Issue with iOS 15.1.

I implement the screen time API and restriction applications on the kid's device. However, I did not receive the shield once that time of some app had expired.. Also, I didn't see a kid device's apps restriction for selection by familyActivityPicker on the parent device.

Also, I didn't see a kid device's apps restriction for selection by familyActivityPicker on the parent device. Please provide the necessary support.

Is the Screen Time API completely broken in the betas?
 
 
Q