What's new in Screen Time API

RSS for tag

Discuss the WWDC22 Session What's new in Screen Time API

Posts under wwdc2022-110336 tag

15 Posts
Sort by:
Post not yet marked as solved
4 Replies
69 Views
AuthorizationCenter.shared.requestAuthorization(for: .individual) returns: (lldb) po error Error Domain=FamilyControls.FamilyControlsError Code=5 "(null)" (lldb) po error.localizedDescription "The operation couldn’t be completed. (FamilyControls.FamilyControlsError error 5.)" What does this error mean? This is on iPadOS Beta 3. Was working fine in Beta 2. More generally, how can one debug such errors? FamilyControlsError exists: https://developer.apple.com/documentation/familycontrols/familycontrolserror But not 100% sure what they map to. I tried mapping them to error codes that I've dug through in the forums but didn't seem to perfectly map. Relevant Tweet: https://twitter.com/vicvijayakumar/status/1495092161821429761
Posted
by kgaidis.
Last updated
.
Post not yet marked as solved
1 Replies
54 Views
Hi Team, I am creating test app with screen time API, after the successful authorization(as child), I tried to turn off screen time under the option available in App. Please find the steps below to repro the crash, Open Settings App after successful authorization Search for the App you have authorized Try turn off the "Screen Time Restriction Settings", it'll turn off Now go to your app Again open the settings app and try to enable the "Screen Time Restriction Settings" Now settings app will get crash. Device : iPad Pro(10.5 inch), iPadOS 16.0 beta
Posted
by Rudraa.
Last updated
.
Post marked as solved
5 Replies
281 Views
I am unable to make any progress regarding DeviceActivityReport. The session from WWDC 2022 covers it very briefly. What I (hopefully correctly) understood is that we need to create an extension of type Activity report and inside it implement the body which is DeviceActivityReportScene that will display the charts and what not. And then in the app, we need to use DeviceActivityReport with SwiftUI to show the report which will be run in sandbox from the extension. But I cannot get anything to show up on the screen. Even when my extension view is just a static text to verify something gets displayed. I am trying to create the device activity report without any filter which should give me all activity data per the docs. This is shown in the Xcode console for the view that uses DeviceActivityReport. 2022-06-17 18:08:47.219785+0200 DeviceActivityTest[9613:954204] [default] LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=66, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler} 2022-06-17 18:08:47.219862+0200 DeviceActivityTest[9613:954204] [default] Attempt to map database failed: permission was denied. This attempt will not be retried. 2022-06-17 18:08:47.219911+0200 DeviceActivityTest[9613:954204] [db] Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=66, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler} 2022-06-17 18:08:47.290070+0200 DeviceActivityTest[9613:954204] [default] Remote viewcontroller request failed: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service with pid 9615 named com.apple.DeviceActivityUI.DeviceActivityReportService.viewservice was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid." UserInfo={NSDebugDescription=The connection to service with pid 9615 named com.apple.DeviceActivityUI.DeviceActivityReportService.viewservice was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid.}
Posted
by nemecek_f.
Last updated
.
Post not yet marked as solved
1 Replies
176 Views
I'm attempting to build with the iOS 16 Screen Time APIs and getting the following error: /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk/System/Library/Frameworks/DeviceActivity.framework/Modules/module.modulemap:2:10: error build: Header 'DeviceActivity-Swift.h' not found I added the DeviceActivity.framework to the target. Is there a setting I missed or could this be a problem with something missing in the Xcode 14 beta?
Posted Last updated
.
Post not yet marked as solved
1 Replies
92 Views
I've been trying to get something to work with the Screen Time API, but almost everything related to it is unimplemented. I checked following links Device Activity https://developer.apple.com/documentation/DeviceActivity Managed Settings https://developer.apple.com/documentation/ManagedSettings Family Control https://developer.apple.com/documentation/FamilyControls Checked videos https://developer.apple.com/videos/play/wwdc2022/110336/ Problems I faced FamilyActivityPicker does not list installed apps on either of the guardian's or child's devices, it only lists the categories. There is no way to allow setting up of restrictions for individual kids, if we have many kids in family. If anyone gone through the same problem please upvote or if anyone has a solution please share Thanks
Posted Last updated
.
Post not yet marked as solved
4 Replies
202 Views
I want to know the structure how to send restrict information from parent to child. When parent sets restriction on parent's device, that information is reflected on the child's device and the child is restricted from using the app and device. I want to know how the restrictions set on the parent's device are transmitted to the child's device. Also, I want to know how to do it. I could even call requestAuthorization and succeed. Does anyone know this?
Posted
by toshi2001.
Last updated
.
Post not yet marked as solved
0 Replies
88 Views
When use the DeviceActivity api to create a DeviceActivityReport, all of the ApplicationActivity.application objects have a nil localizedDisplayName. ApplicationActivity(application: ManagedSettings.Application(bundleIdentifier: Optional("com.netflix.Netflix"), token: nil, localizedDisplayName: nil), totalActivityDuration: 0.0, numberOfPickups: 0, numberOfNotifications: 1, isTrusted: true) I see in the documentation for Application.localizedDisplayName the following: In an extension that provides shield configurations, this property provides the app’s name. When you access this property outside that extension, the value is nil. See ShieldConfigurationDataSource in the Managed Settings UI framework for more information. I am using the property in an extension that provides shield configurations so it should not be nil. I do see that ManagedSettings.ActivityCategory.localizedDisplayName is set properly and that in its documentation that it has the same requirement with shield configurations. CategoryActivity(category: ManagedSettings.ActivityCategory(identifier: Optional("DH1003"), token: nil, localizedDisplayName: Optional("Entertainment")), totalActivityDuration: 0.0, applicationActivities: [DeviceActivity.DeviceActivityData.ApplicationActivity(application: ManagedSettings.Application(bundleIdentifier: Optional("com.google.ios.youtube"), token: nil, localizedDisplayName: nil), totalActivityDuration: 0.0, numberOfPickups: 0, numberOfNotifications: 1, isTrusted: true), DeviceActivity.DeviceActivityData.ApplicationActivity(application: ManagedSettings.Application(bundleIdentifier: Optional("com.microsoft.smartglass"), token: nil, localizedDisplayName: nil), totalActivityDuration: 0.0, numberOfPickups: 0, numberOfNotifications: 3, isTrusted: true)], webDomainActivities: []) Since categories' display names are being set correctly, this seems like a bug in the beta to me. Has anyone else seen this issue?
Posted
by tjpaul.
Last updated
.
Post not yet marked as solved
2 Replies
222 Views
Hi Team, With the new Screen Time API, I have a question: with DeviceActivity, will the parent have access to DeviceActivity Data and DeviceActivity report of his children?
Posted
by mvpaudrey.
Last updated
.
Post not yet marked as solved
1 Replies
220 Views
I'm attempting to authorize family controls as .individual in the latest Xcode 14 beta (14A5228q). do { try await AuthorizationCenter.shared.requestAuthorization(for: .individual) } catch { print(error.localizedDescription) dump(error) } Running this on the iPhone 13 Simulator (iOS 16), it throws the following error: The operation couldn’t be completed. (FamilyControls.FamilyControlsError error 3.) - Error Domain=FamilyControls.FamilyControlsError Code=3 "(null)" #0 - super: NSObject I have a dedicated App ID and have enabled the "Family Controls" capability. An Apple Systems Engineer suggested in this thread that "Requesting FamilyControls authorization on Simulator is supported by the ScreenTime API", although they don't say whether it actually works or not. The rest of the thread seems to suggest people are also having issues when running on a physical device so I'm reluctant to install the iOS 16 Beta as I use my phone daily for work projects. Is this FamilyControls authorization supposed to work in Simulator and are there any special considerations when authorizing as .individual?
Posted
by philtre.
Last updated
.
Post not yet marked as solved
0 Replies
119 Views
Hello, Is it possible to make a FaceID authentication (LAContext) inside the ShieldActionDelegate extension in the func handle(action: ShieldAction...) callback? Or is it possible to open the host app to do this authentication for us? Right now using LAContext.evaluatePolicy (with FaceID) gives this error: User interaction required. And there is no API to open the host app. Or any other ideas how to have some extra options/operations in the handle caller? Thank you
Posted Last updated
.
Post marked as solved
1 Replies
156 Views
The FamilyActivityPicker only allows to select applications & their categories (tested on iPad). However, the docs say: A view in which users specify applications, web domains, and categories without revealing their choices to the app. Where can I select web domains in the FamilyActivityPicker? Then, it seems like ManagedSettingsStore can only be used with tokens. It can't be used with explicitly initialized WebDomain structs. For example, managedSettingsStore.webDomains = [WebDomain(domain: "bad website")] is not possible to do? As a result, without the ability to get website tokens, it seems impossible to shield websites? However, it does seem possible to block websites with the web filter.
Posted
by kgaidis.
Last updated
.
Post marked as solved
1 Replies
291 Views
2022-06-15 13:19:43.606183-0400 App Name Notification test[594:18404] [UIFocus] TtGC7SwiftUI14_UIHostingViewGVS_15ModifiedContentVS_7AnyViewVS_12RootModifier_ implements focusItemsInRect: - caching for linear focus movement is limited as long as this view is on screen. 2022-06-15 13:19:43.677534-0400 App Name Notification test[594:18436] [xpc] Connection error from Optional("com.apple.FamilyControlsAgent"): Couldn’t communicate with a helper application.  Attempts remaining: 1 Failed to enroll Luis with error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.FamilyControlsAgent was invalidated: failed at lookup with error 159 - Sandbox restriction." UserInfo={NSDebugDescription=The connection to service named com.apple.FamilyControlsAgent was invalidated: failed at lookup with error 159 - Sandbox restriction.}
Posted
by Jack1886.
Last updated
.
Post not yet marked as solved
0 Replies
107 Views
Hello, Is it possible to make a FaceID authentication (LAContext) inside the ShieldActionDelegate extension in the func handle(action: ShieldAction...) callback? Or is it possible to open the host app to do this authentication for us? Right now using LAContext.evaluatePolicy (with FaceID) gives this error: User interaction required. And there is no API to open the host app. Or any other ideas how to have some extra options/operations in the handle caller? Thank you
Posted Last updated
.