Meet the Screen Time API

RSS for tag

Discuss the WWDC21 session Meet the Screen Time API.

View Session

Posts under wwdc21-10123 tag

54 results found
Sort by:
Post not yet marked as solved
24 Views

Unable to see list of child's application in Family Activity Picker

Hi, In child's app I could successfully get list of applications in Family Activity Picker after Parental authorisation but I couldn't get list of child's applications from the parent app.
Asked
by Shani612.
Last updated
.
Post marked as solved
274 Views

When "Family Control" will be available for AppStore and AdHoc distribution?

Hello! Does anybody know release date of "Family Control" capability for Distribution? iOS 15 was released, but "Family Control" is still available only for Development Distribution: We can't create Distribution provision profile for testing via TestFlight right now. Furthermore we can't proof that Content Filter Providers will be work on authorized Family Control devices without any restrictions and additional setup (see Content Filter Providers with Family Control app)
Asked Last updated
.
Post not yet marked as solved
1.7k Views

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.
Asked
by clawoo.
Last updated
.
Post marked as solved
1.1k Views

ScreenTime API on non-Family Sharing Devices

Hello, thank you for building a Screen Time API. In my reading of of the API, it seems that all components rely on Family Controls, which require a parent to authorize on a child's device. Will Screen Time API work in contexts where there are no children's devices? Can an individual authorize Family Controls on their own phone? Here is a use case: Imagine a user who wants to restrict access to certain apps until they have worked out for 30 minutes a day. We would use Device Activity and Managed Settings to effectuate this app.
Asked
by fstutzman.
Last updated
.
Post not yet marked as solved
361 Views

Screen Time Guardian App Questions

WWDC21 session 10123 shows a screen that implies the guardian instance of your app is able to select apps on your child's device to encourage or to control. In my experience with the API so far I can't see a way to do this. The API only seems to work on the child's phone. Here are my questions: Is there a suggested way to determine whether the app is running on a guardian device? The only way I can see is to attempt AuthorizationCenter.shared.requestAuthorization and check for an error value of .invalidAccountType. But it seems you could get that error for other reasons too. Is there a way to present FamilyActivityPicker on the guardian device but have it show apps on the child's phone? I don't see any thing in the API for selecting a child account to access with `FamilyActivityPicker', it seems to only show the phone's user's apps (or no apps if it's the guardian's phone). After retrieving app tokens from 'FamilyActivityPicker' is there a recommended way to present to the user in the UI? The WWDC session shows an app icon and app name (i.e. "Books" and "Solar System"), but my understanding is that info is hidden from the developer for privacy reasons. So I'm wondering if the example in the session is really feasible.
Asked
by pinch.
Last updated
.
Post not yet marked as solved
179 Views

Where can I download the homework demo code

As Video said, here is a demo app called "homework" that would provided for developer to know how to use Screen Time API. However, I cannot find this demo code in the Apple Developer Sample Code website. Does anyone know where can I find it ? Thanks
Asked
by LionK56.
Last updated
.
Post not yet marked as solved
51 Views

Get alarms time in clock app in my custom app

I want to get the alarms time set by user in the default alarm app in my custom app. Is there any way to do it, With the latest Screen time Api & Device Activity can we achieve this ??
Asked
by TusharB.
Last updated
.
Post marked as solved
411 Views

Designate principal class

Hello, I am wondering how to designate my DeviceActivityMonitor extension as the principal class on Xcode 13 beta 5 Documentation: https://developer.apple.com/documentation/deviceactivity/deviceactivitymonitor
Asked
by alfonce.
Last updated
.
Post not yet marked as solved
117 Views

Can I manage restrictions from the parent's application?

I managed to achieve the list of children's applications on the parent device. But I can't manage restrictions for these applications. Is it only available from the child's device or there is a solution for the app management from the parent's app?
Asked
by yuraist.
Last updated
.
Post not yet marked as solved
601 Views

Unable to see the list of Applications in FamilyPicker for the parent device

I am able to see the list of Applications using the Family ActivityPicker on the child but not able to see it on the parent device. I can see the list of categories but there aren't any applications on each of the categories. My expectation is to see the applications which are installed on the child device. Please correct me if that is not the expected behavior. The family sharing is setup correctly, and on requesting authorization, it does fail to get the authorization as expected, because it's the parent account. I do see the correct behavior on the child device. I did provide authorization and I can see the list of applications inside the picker on Beta 2. On the parent device I see the following errors in the console : Connection error from Optional("com.apple.ManagedSettingsAgent"): Couldn’t communicate with a helper application.  Attempts remaining: 1 Failed to fetch effective value for com.apple.ManagedSettings.effective-media-settings.changed: Couldn’t communicate with a helper application. Failed to open usage store with error: The file “Store.plist” couldn’t be opened because there is no such file. Any ideas?
Asked
by nmik2020.
Last updated
.
Post not yet marked as solved
72 Views

Keyword Blocking on Screen Time API

Does the new Screen Time API allow keyword blocking as well? Not just individual URLs? Requested URLs in browsers and apps would be scanned and blacklisted keywords would stop the request from being processed. Is that possible with the new API?
Asked
by ServusJon.
Last updated
.
Post not yet marked as solved
354 Views

How does the Screen Time API handle multiple children and multiple devices?

Hi! There weren't any mentions in the video and documentation on how the Screen Time API handles multiple children and multiple devices. Specifically, cases like this: Multiple children with one device per child Multiple children with multiple devices per child (e.g. iPhone + iPad) Parent/guardian with multiple devices The FamilyActivityPicker doesn't take any parameters. What will happen when a parent with multiple kids opens the picker? Thanks.
Asked
by khanov.
Last updated
.
Post not yet marked as solved
596 Views

Is it possible to request FamilyControls authorization on simulator?

I'm getting a FamilyControlsError Code=3 when requesting authorization from a simulator signed in with a child iCloud account. When requesting authorization from a simulator signed in with a parent iCloud account I receive the expected FamilyControlsError Code=2. There's not a lot of info on resolving these errors, and the code is pretty simple: func requestAuthorization() {     AuthorizationCenter.shared.requestAuthorization { result in         switch result {         case .success():             print("Sucess...")         case .failure(let error):             print("Failed... \(error)")         }     } }
Asked
by rkotzy.
Last updated
.
Post not yet marked as solved
745 Views

Family Controls application-identifier Entitlement error while blocking an application

I was able to start the device activity monitor. I was able to see the Device Activity Monitor Extension as a process, and was able to attach to it via Xcode. Now I am trying block a specific 3rd party application, via the Shield. I am using this piece of code for intervalDidStart :    override func intervalDidStart(for activity: DeviceActivityName) {     NSLog("Interval started for Device Activity")     let blockedApps : Set<Application> = [Application(bundleIdentifier: "com.facebook.Facebook")]     store.application.blockedApplications = blockedApps     super.intervalDidStart(for: activity) } I've declared store in the DeviceActivityMonitor class as follows :    let store = ManagedSettingsStore() This is the error I see in the Console: Error Domain=UsageTrackingErrorDomain Code=1 "Something without a application-identifier entitlement tried to manage usage budgets" UserInfo={NSLocalizedDescription=Something without a application-identifier entitlement tried to manage usage budgets} The above use case should work right? I should be able to apply the settings inside DeviceActivityMonitorExtension? What does the application-identifier entitlement look like? How do I use it?
Asked
by nmik2020.
Last updated
.