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 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.3k 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
895 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.9k 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
1.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.3k 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.9k 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
816 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
757 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
.