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

19 Posts
Sort by:
Post marked as solved
2 Replies
1.1k Views
There is frequently a delay of a few seconds before a DeviceActivityReport renders its view generated from the DeviceActivityReportExtension. It will also sometimes flash with zero data before hydrating with the real activity data (tested with extension code taken directly from XCode boilerplate) Is there a way to be notified when the DeviceActivityReport renders successfully or is still processing, i.e. so a loading indicator can be presented while the extension runs? Thanks!
Posted
by foijodsf.
Last updated
.
Post not yet marked as solved
3 Replies
2.2k Views
I've requested for family control via: https://developer.apple.com/contact/request/family-controls-distribution & got approved. I've now created new provision files with family control being checked in the identifiers & uploaded manually. Yet, still get: Provisioning profile "redoAppStore" doesn't support the Family Controls capability. Provisioning profile "redoAppStore" doesn't include the com.apple.developer.family-controls entitlement. The family control capability is added to my main target (IOS app) as well. What should I do to get it uploaded?
Posted Last updated
.
Post not yet marked as solved
2 Replies
850 Views
Hi, I’d like to access the source code for the demo app from whats new in screen time api. Can I get a copy of it through email or can you post it under sample code of wwdc 22 section?
Posted Last updated
.
Post not yet marked as solved
7 Replies
1.8k Views
Every time I present an application title using SwiftUI view using Label(some_token) I get 3x of these logs, which sometimes incurs a noticeable lag in displaying my containing view. Otherwise the icon + title display correctly. I have tried making the most simple SwiftUI View just containing Label(some_token) without any other code, no state, no navigation, no transitions, no other views, just that and I still get this - usually in triplicate: [activityItem] Label is already or no longer part of the view hierarchy [activityItem] Label is already or no longer part of the view hierarchy [activityItem] Label is already or no longer part of the view hierarchy If I use .labelStyle(.titleOnly) I only see it twice. Here's the code I used var body: some View { VStack { // uses a static token provided just for testing. // same behavior regardless of how the token is passed in. Label(some_static_token) .labelStyle(.titleOnly) } } Is this log something to be expected?
Posted
by heykurt.
Last updated
.
Post not yet marked as solved
1 Replies
1k Views
I'm looking for a way to check user Screen Time and trigger a notification after a specified amount of time on certain apps. I have the code from WWDC21 but I was wondering if I could get the code sample for the Worklog app created for WWDC22. Would really help as a reference point for building my project. Thank you!
Posted
by blanny21.
Last updated
.
Post not yet marked as solved
3 Replies
1.5k Views
I've implemented shielding apps with new Screentime API. But I don't know how to shield all categories app except the app selected by user in the FamilyActivityPicker? Here is my code to shield apps and it worked. But I want to know if I could shield all apps and all "categories" except the apps user selected. I want to allow only the apps and categories that user has selected. let store = ManagedSettingsStore() if let object = UserDefaults.standard.object(forKey: "SelectedAppTokens") as? Data { let decoder = JSONDecoder() if let appTokens = try? decoder.decode(Set<ApplicationToken>.self, from: object) { store.shield.applicationCategories = ShieldSettings.ActivityCategoryPolicy.all(except: appTokens) } } I save 'applicationTokens' from FamilyActivityPicker and shield with it.
Posted
by ypunval.
Last updated
.
Post not yet marked as solved
1 Replies
1.2k Views
I am building a screen time restricting app that shields certain apps. I would like to know when users attempt to "cheat" by adding an app to the "Always Allowed" list in the Screen Time Settings. Having a way to detect when the user takes this action would be helpful. I've explored other options but they all seem to fall short: If I set store.shield.applications, that will also shield "Always Allowed" apps, but unfortunately, this is restricted to 50 apps. This would be ideal, if not for the 50 apps limit. If I set a store.shield.applicationCategories policy, this will not shield the "Always Allowed" apps. Using a DeviceActivityMonitor.eventDidReachThreshold callback, but this is triggered regardless of whether or not the shield is visible. Ideally, it would only be triggered for unshielded apps. Trying to indicate the shield is visible from the ShieldConfigurationDataSource, but this extension is sandboxed for privacy reasons so I cannot communicate back to the hosting app. Is what I'm requesting possible? Thanks
Posted
by noelm.
Last updated
.
Post not yet marked as solved
4 Replies
2.2k Views
Hello, The purpose of "Screen Time Passcode" under Settings/Screen Time is to protect Screen Time preferences and it is asked every time the user updates Downtime, App Limits, Content & Privacy Restrictions and so on. But the private passcode is not requested if the user disables Screen Time for a particular app (only Face ID or phone passcode is requested, but not the private Screen Time passcode). I think this is a mistake, I think the purpose of a private Screen Time passcode is to protect all settings, including apps that use this API, right? Is there any solution to this? Thank you.
Posted Last updated
.
Post not yet marked as solved
5 Replies
2.8k Views
We have developed a Parental/Self control app using Screen time API. We have used individual authentication to authorize the app, using the instructions here: https://developer.apple.com/documentation/familycontrols/authorizationcenter The problem is , that individual auth can be disabled easily , by the following steps: enter Settings app. in Settings app, click on the Parental/Self control app. click to disable screen time restriction. show the device owner's face/fingerprint. (or pin code) Why is that a problem: Parental control apps, or self-control apps, are about giving control to the software, To make it hard for the user to disable the restrictions. So using the flow I have introduced above, it's super-easy for a user to disable his Parental control restrictions, which misses the entire point of Parental/Self control idea. Furthermore, not only the user have the means to unlock his screen time restrictions, he also MUST have the means to unlock it. This makes Screen time (with individual auth) useless: I have a code ready to make a great parental control app for my clients, with amazing ideas, but I can't use the Screen time API unless this problem is fixed. Why child-parent auth is not enough: My clients are grownups people between ages of 15-40, that are interested in self-control, so they don't have iCloud child accounts. also, the child-parent auth solution forces my clients to give some control to other person, and my clients prefer their privacy. Some of them prefer self-control and not parental-control. What I suggest as a solution: 1: Give more options to users how to disable the Screen time restrictions. including: a second faceID / FingerPrint (that isn't the same as the one used to unlock the device) a second pin password. a string password 2: Give the users the option to choose to not have the device's owner Face/Finger/Pincode ID , as a method to disable the Screen time restrictions.
Posted
by odd1add1.
Last updated
.
Post marked as solved
1 Replies
782 Views
I'm using the 'store.webContent.blockedByFilter' feature to block malicious domains on iOS 16.4. However, I have a list of over 20,000 domains to block, and I'm concerned if there's a limit to the number of domains I can include. let store = ManagedSettingsStore() var blockedDomains: Set<WebDomain> = [] /*contains over 20000 domains names*/ let blackList: [String] = getBlacklistedDomains() for domain in blackList { let webDomain = WebDomain(domain: domain) blockedDomains.insert(webDomain) } store.webContent.blockedByFilter = WebContentSettings.FilterPolicy.specific(blockedDomains) With this code it appears that either no domains are being blocked or only a few are affected. Will having such a large list cause any issues or performance problems?
Posted
by LeoB.
Last updated
.
Post not yet marked as solved
0 Replies
702 Views
I am trying to understand how much I can do with shield actions, if anything. So at its basic, the shield action has 3 options, none, defer, and close. I believe defer is used to rebuild the shield if needed (for example, a parent allowing their child to open the app). Can this be used as a button to just straight up bypass the shield? Like if a user taps button one, it would run shield action close, if taps button two, it would bypass the shield and open the app? If so, how would one bypass since t he handler requires the shield action options? override func handle(action: ShieldAction, for application: ApplicationToken, completionHandler: @escaping (ShieldActionResponse) -> Void) { switch action { case .primaryButtonPressed: completionHandler(.close) case .secondaryButtonPressed: completionHandler(.defer) @unknown default: fatalError() } }
Posted
by chasecc.
Last updated
.
Post not yet marked as solved
1 Replies
766 Views
Modifying the WebContentSettings.FilterPolicy of a managedSettingsStore object to so that its type is not .none removes the private browsing capability in Safari by default. Is there a way to avoid this? Is this mentioned somewhere in the documentation? Are there any other unexpected side-effects of modifying the WebContentSettings.FilterPolicy?
Posted Last updated
.
Post not yet marked as solved
0 Replies
597 Views
I'd like to allow users to select apps to shield from a DeviceActivityReport (similar to how Apple's Screen Time Settings activity report allows a user to "add limits" to a selected app in the report. What I need to do is pass an appToken from the DeviceActivityReportExtension to my app. I realize the extension is sandboxed and doesn't allow "private" data to be seen outside of the sandbox. The docs state: To protect the user’s privacy, your extension runs in a sandbox. This sandbox prevents your extension from making network requests or moving sensitive content outside the extension’s address space. However, tokens aren't "sensitive". I want to pass a token set out of the sandboxed extension so users can select certain apps from the report that my app can use for setting limits, etc. I thought using App Groups and saving data with UserDefaults with a suiteName for my app group would do it, but it doesn't appear to allow me to pass the token data. Yes I'm using the same KEY for both as I set a config enum to ensure it's the same and I can pass tokens successfully between other extensions/apps in the app group, but not the report extension. It seems the app and the extension have their own stores as the report extension can write to and read from a store but despite being the same suiteName, other apps in the app group don't get or send data to the Report Extension. I realize this is probably due to the design with the sandbox to protect user privacy, however it seems an exception should be made for passing tokens (or even better allow passing through another method like a callback, etc). Is there ay way to accomplish passing a token from the sandboxed report extension to my app?
Posted Last updated
.
Post not yet marked as solved
3 Replies
1.2k Views
Good afternoon. I have a question, the answer to which I did not find in the documentation. Let's imagine that there is a parent device and two or more children (each child device received authorization "AuthorizationCenter.shared.requestAuthorization(for: .child)"), an application is installed on each of the devices. All accounts (parent and child) are members of the same Family group. How can I show the familyActivityPicker on the parent device and display information there separately for each of the children's devices. As I see it, familyActivityPicker shows either applications from one of the children's devices or all applications from all children's devices, which seems very inconvenient to me. If you call familyActivityPicker on the application directly on the child's device, then the applications that correspond to this device are shown. If you watch the native Screen Time application on the parent device, there is a choice of children's devices. Thank you!
Posted
by YuriyT.
Last updated
.
Post not yet marked as solved
2 Replies
762 Views
I've created a new project to see how "DeviceActivityReportExtension" works. After creating the app, added the extension and also added "FamilyControl" capability. In the main, I've added only the report view using SwiftUI, but it does not work. This is the error I get: 2023-04-27 18:21:55.980280-0700 TestScreenTime[38540:24995233] [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} 2023-04-27 18:21:55.980313-0700 TestScreenTime[38540:24995233] [default] Attempt to map database failed: permission was denied. This attempt will not be retried. 2023-04-27 18:21:55.980337-0700 TestScreenTime[38540:24995233] [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} 2023-04-27 18:21:56.029480-0700 TestScreenTime[38540:24995233] [default] Remote viewcontroller request failed: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service with pid 38542 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 38542 named com.apple.DeviceActivityUI.DeviceActivityReportService.viewservice was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid.} The deployment target is set to 16.0, and Xcode version is 14.3 (14E222b).
Posted
by coolneo4u.
Last updated
.