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

84 Posts

Post

Replies

Boosts

Views

Activity

DeviceActivityReport inconsistencies
Hello, I want to echo the DeviceActivityReport "concurrency" problems flagged in https://developer.apple.com/forums/thread/720549, and ask a related question. (Thanks to Kmart and other Apple dev support folks who have been monitoring these forums and responding diligently.) I would like to display daily and weekly stats in the same view, broken down by specific apps (as in the native Screen Time). However, instantiating multiple DeviceActivityReport objects with different filters and/or different contexts leads to confusion, where the two views will incorrectly and intermittently swap data or duplicate data where it shouldn't (seemingly upon some interval when the extension provides fresh data). There isn't documentation on how to display multiple reports at once. Is the idea that logic for multiple reports should be embedded within the extension itself in the makeConfiguration() function and there should only be a single DeviceActivityReport in the main App, or is this a bug? Even with a single DeviceActivityReport, I run into inconsistencies where the View provided by the extension takes multiple seconds to load or fails to load altogether. The behavior seems random...I will build the application with the same code multiple times and see different behavior each time. Finally, a plug for better support in the Simulator for the entire set of Screen Time APIs. Thanks!
6
1
2.2k
4d
Screen time API can be disabled easily
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.
19
3
7.2k
3w
Token Selection from DeviceActivityReport
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?
1
0
1k
Aug ’25
Changing Screen Time Passcode does not protect apps with Screen Time enabled
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.
6
4
4.5k
May ’25
Shield Customisation Not Applying
Hi, I've been attempting to implement a customised shield based on the WWDC contents and documentation; however, while my configuration appears correct only the default "Restricted - You cannot use X app because it's restricted" ever displays. A quick summary of what I have done: Created a ShieldConfigurationExtension Ensured suitable Info.plist values - below Defined custom Shield within the configuration() methods - application example below Any suggestions on what might not be implemented correctly? Info.plist <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>NSExtension</key> <dict> <key>NSExtensionPointIdentifier</key> <string>com.apple.ManagedSettingsUI.shield-configuration-service</string> <key>NSExtensionPrincipalClass</key> <string>$(PRODUCT_MODULE_NAME).ShieldConfigurationExtension</string> </dict> </dict> </plist> Configuration import ManagedSettings import ManagedSettingsUI import UIKit class ShieldConfigurationExtension: ShieldConfigurationDataSource {       override func configuration(shielding application: Application) -> ShieldConfiguration {     // Customize the shield as needed for applications.     return ShieldConfiguration(       backgroundBlurStyle: UIBlurEffect.Style.systemThickMaterial,       backgroundColor: UIColor.white,       icon: UIImage(systemName: "stopwatch"),       title: ShieldConfiguration.Label(text: "No app for you", color: .yellow),       subtitle: ShieldConfiguration.Label(text: "Sorry, no apps for you", color: .white),       primaryButtonLabel: ShieldConfiguration.Label(text: "Ask for a break?", color: .white),       secondaryButtonLabel: ShieldConfiguration.Label(text: "Quick Quick", color: .white)     )   } }
5
0
2.7k
Aug ’24
Loading indicator until DeviceActivityReport renders?
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!
3
1
2.2k
Apr ’24
"Doesn't support the Family Controls capability." Even after getting accepted for family control
I've requested for family control via: https://developer.apple.com/contact/request/family-controls-distribution &amp; got approved. I've now created new provision files with family control being checked in the identifiers &amp; 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?
4
0
3.8k
Apr ’24
Device Activity Label constantly logging 3x error
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?
9
1
3.1k
Aug ’23
Can I get code examples of the Worklog app that was shown on WWDC22?
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!
2
0
1.5k
Aug ’23
How to shield the categories with Family Controls in iOS
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.
4
0
2.4k
Jun ’23
Detect when shielded app is added to "Always Allowed" in Screen Time Settings
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
1
2
1.5k
Jun ’23
Screen Time API | Is there a limited number of Web domains that can be blocked with a ManagedSettings filtering policy?
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?
1
0
1.3k
May ’23
Shield Action Buttons
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() } }
1
0
1.2k
May ’23
WebContentSettings .some disables Safari private browsing mode
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?
1
0
1.1k
May ’23
FamilyActivityPicker for multiple child's devices
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!
5
1
1.8k
May ’23
DeviceActivityReport inconsistencies
Hello, I want to echo the DeviceActivityReport "concurrency" problems flagged in https://developer.apple.com/forums/thread/720549, and ask a related question. (Thanks to Kmart and other Apple dev support folks who have been monitoring these forums and responding diligently.) I would like to display daily and weekly stats in the same view, broken down by specific apps (as in the native Screen Time). However, instantiating multiple DeviceActivityReport objects with different filters and/or different contexts leads to confusion, where the two views will incorrectly and intermittently swap data or duplicate data where it shouldn't (seemingly upon some interval when the extension provides fresh data). There isn't documentation on how to display multiple reports at once. Is the idea that logic for multiple reports should be embedded within the extension itself in the makeConfiguration() function and there should only be a single DeviceActivityReport in the main App, or is this a bug? Even with a single DeviceActivityReport, I run into inconsistencies where the View provided by the extension takes multiple seconds to load or fails to load altogether. The behavior seems random...I will build the application with the same code multiple times and see different behavior each time. Finally, a plug for better support in the Simulator for the entire set of Screen Time APIs. Thanks!
Replies
6
Boosts
1
Views
2.2k
Activity
4d
Screen time API can be disabled easily
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.
Replies
19
Boosts
3
Views
7.2k
Activity
3w
Token Selection from DeviceActivityReport
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?
Replies
1
Boosts
0
Views
1k
Activity
Aug ’25
Changing Screen Time Passcode does not protect apps with Screen Time enabled
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.
Replies
6
Boosts
4
Views
4.5k
Activity
May ’25
Shield Customisation Not Applying
Hi, I've been attempting to implement a customised shield based on the WWDC contents and documentation; however, while my configuration appears correct only the default "Restricted - You cannot use X app because it's restricted" ever displays. A quick summary of what I have done: Created a ShieldConfigurationExtension Ensured suitable Info.plist values - below Defined custom Shield within the configuration() methods - application example below Any suggestions on what might not be implemented correctly? Info.plist <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>NSExtension</key> <dict> <key>NSExtensionPointIdentifier</key> <string>com.apple.ManagedSettingsUI.shield-configuration-service</string> <key>NSExtensionPrincipalClass</key> <string>$(PRODUCT_MODULE_NAME).ShieldConfigurationExtension</string> </dict> </dict> </plist> Configuration import ManagedSettings import ManagedSettingsUI import UIKit class ShieldConfigurationExtension: ShieldConfigurationDataSource {       override func configuration(shielding application: Application) -> ShieldConfiguration {     // Customize the shield as needed for applications.     return ShieldConfiguration(       backgroundBlurStyle: UIBlurEffect.Style.systemThickMaterial,       backgroundColor: UIColor.white,       icon: UIImage(systemName: "stopwatch"),       title: ShieldConfiguration.Label(text: "No app for you", color: .yellow),       subtitle: ShieldConfiguration.Label(text: "Sorry, no apps for you", color: .white),       primaryButtonLabel: ShieldConfiguration.Label(text: "Ask for a break?", color: .white),       secondaryButtonLabel: ShieldConfiguration.Label(text: "Quick Quick", color: .white)     )   } }
Replies
5
Boosts
0
Views
2.7k
Activity
Aug ’24
Loading indicator until DeviceActivityReport renders?
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!
Replies
3
Boosts
1
Views
2.2k
Activity
Apr ’24
"Doesn't support the Family Controls capability." Even after getting accepted for family control
I've requested for family control via: https://developer.apple.com/contact/request/family-controls-distribution &amp; got approved. I've now created new provision files with family control being checked in the identifiers &amp; 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?
Replies
4
Boosts
0
Views
3.8k
Activity
Apr ’24
How do I get Applications in categoryTokens
I want to hide apps in categories
Replies
2
Boosts
0
Views
1.1k
Activity
Oct ’23
Requesting source code of worklog
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?
Replies
2
Boosts
1
Views
1.3k
Activity
Sep ’23
Device Activity Label constantly logging 3x error
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?
Replies
9
Boosts
1
Views
3.1k
Activity
Aug ’23
Can I get code examples of the Worklog app that was shown on WWDC22?
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!
Replies
2
Boosts
0
Views
1.5k
Activity
Aug ’23
DeviceActivityCenter Silent Failing
Anyone else have this problem where the DeviceActivityCenter is silently failing/hanging on startMonitoring? No error caught but the code won't progress, and the intervalDidStart never runs.
Replies
2
Boosts
0
Views
1.7k
Activity
Jul ’23
How to shield the categories with Family Controls in iOS
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.
Replies
4
Boosts
0
Views
2.4k
Activity
Jun ’23
iOS Screen Time enabled check
Is there a programmatic way to check if a user has iOS Screen Time enabled on their device?
Replies
2
Boosts
1
Views
2k
Activity
Jun ’23
Detect when shielded app is added to "Always Allowed" in Screen Time Settings
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
Replies
1
Boosts
2
Views
1.5k
Activity
Jun ’23
Where can I download the demo for ScreenTime?
Where can I download screentime demo 'Worklog'? I couldn't found it on sample section? Apple didn't provide demo for ScreenTime in last WWDC neither.
Replies
9
Boosts
5
Views
4.2k
Activity
Jun ’23
Screen Time API | Is there a limited number of Web domains that can be blocked with a ManagedSettings filtering policy?
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?
Replies
1
Boosts
0
Views
1.3k
Activity
May ’23
Shield Action Buttons
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() } }
Replies
1
Boosts
0
Views
1.2k
Activity
May ’23
WebContentSettings .some disables Safari private browsing mode
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?
Replies
1
Boosts
0
Views
1.1k
Activity
May ’23
FamilyActivityPicker for multiple child's devices
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!
Replies
5
Boosts
1
Views
1.8k
Activity
May ’23