Managed Settings

RSS for tag

Set restrictions for certain settings, such as locking accounts in place, preventing password modification, filtering web traffic, and shielding apps.

Posts under Managed Settings tag

108 Posts
Sort by:
Post not yet marked as solved
9 Replies
17k Views
When reinstalling MacOS I run into issues in the Remote Management section during installation. After establishing a network connection, I proceed to the Remote Management section of the installation and the setup is failing with an error "Unable to connect to the MDM server for your organisation.". Is there any way how I can resolve this issue manually? Because there is no way how to bypass this step in the setup.
Posted
by
Post marked as solved
4 Replies
2.4k Views
Hi folks! Please help me to clarify some things related to Screen Time API. What the keys differences between individual and child authorization? With individual type of auth user can do sign-out from iCloud and delete the app. What else differentiate this type of users? Can we use DeviceActivityEvent for remote control with individual auth? Can the parental or guardian see/get the statistic of apps usage? Is the individual auth available to all users or just those who are in the Apple's family? I'll really appreciate any help and answer! Thank you in advance!
Post marked as solved
3 Replies
2.7k Views
Hi all! I'm thankful to Kmart for his answers related to Screen Time API features iOS 15 / iOS 16. That really helpful! Please, help me to clarify a few more things... As I read here in the comment ManagedSettings has two type of restrictions, shielding and blocking. Is blocking type of restriction available for users with individual type of auth? If the answer on the first question is "No", does that mean that individual user will be able just to skip the shielding screen and continue to use apps? If individual user can skip shielding, will it be allowed to do it with a passcode or without, if the passcode wasn't set for Screen Time in the phone settings? I'll really appreciate any help and answer! Thank you in advance!
Post not yet marked as solved
3 Replies
1.1k Views
Hello! I believe there is a bug: ShieldConfigurationDataSource extension does not update when the app to be blocked is already open and the ManagedSettingsStore.shield.applications is set to the app that is already open. The shield comes up but has a stale ShieldConfiguration not reflecting the current state of the app is used. I've been able to replicate the issue in an independent app "OffScreen". If you start a blocking time range from 10:00-10:15, it will say "No Twitter until 10:15" and then open Twitter at 10:15. If there is another blocking time range from 10:16-10:31, the app will be open until 10:16 when the shield will reactivate and it will still say "No Twitter until 10:15" when is should say "No Twitter until 10:31". thanks!
Posted
by
Post not yet marked as solved
6 Replies
2.1k Views
When I tap on one of the buttons in the ShieldAction extension I want to close the shield and open the parent app instead of the shielded app. Is there any way of doing this using the Screen Time API? class ShieldActionExtension: ShieldActionDelegate {      override func handle(action: ShieldAction, for application: ApplicationToken, completionHandler: @escaping (ShieldActionResponse) -> Void) {     // Handle the action as needed.           let store = ManagedSettingsStore()               switch action {     case .primaryButtonPressed:       //TODO - open parent app       completionHandler(.defer)     case .secondaryButtonPressed:       //remove shield       store.shield.applications?.remove(application)       completionHandler(.defer)         @unknown default:       fatalError()     }   }   }
Posted
by
Post marked as solved
6 Replies
2.6k Views
Hi there! Please help me coupe with next issue... The project was building and archived without any issue. When I added Family Control capability, I started receiving this issue: I set up all certificates, created provisions. Tried to do it automatically through Xcode, did it manually, created .certSigningRequest, changed Xcode to 13 version (I'm using 14) - nothing helped me. Please share your thoughts what can be wrong? I'm not owner of Apple's dev account. I have Admin access rights. Do I need something else? Is Apple requires additional permissions or some requests to use Family Control capability? Thank you in advance! missing com.apple.developer.family-controls / Missing Family Controls from provisioning profile
Post not yet marked as solved
4 Replies
1.6k Views
I've followed along with the Screen Time API demos (https://developer.apple.com/videos/play/wwdc2021/10123/) Also followed along with this guide, which is essentially the same: https://www.folio3.com/mobile/blog/screentime-api-ios/ I'm able to restrict access to apps/categories with the FamilyActivityPicker and FamilyActivitySelection. I can set a DeviceActivitySchedule, and then use DeviceActivityCenter to start monitoring it. I can tell that the schedule is working, because MyMonitor:intervalDidStart() does get called, and it works except for the restricting of apps/categories/webCategories. It's as if MyModel does not have any values set from within MyMonitor. I've confirmed that MyModel does have the correct FamilyActivitySelection apps etc, everywhere else in my Target, before and after the MyMonitor:intervalDidStart() gets called. MyMonitor is in a separate target called MonitorExtension, that I created using the Device Activity Monitor Extension template. But I made sure to set the Target Membership of MyModel to both my main target, and my extension target. I have set NSExtensionPrincipalClass to $(PRODUCT_MODULE_NAME).MyMonitor, as suggested. I have added MyModel.swift to the Compiled Sources in my extensions Build Phases. I have edited my apps build scheme, to make sure the extension target is also built. One more interesting thing is that debugger breakpoints and print statements do not work from within my extension. I've even tried caching a string from within MyMonitor:intervalDidStart, and tried to retrieve it afterwards in my main target, but it is nil. Still, I've confirmed that intervalDidStart was actually called by adding any removing store.application.denyAppInstallation = true, and having it work correctly. I've spent so much time on this problem, any help would be massive.. Here are the files I've referenced: import UIKit import MobileCoreServices import ManagedSettings import DeviceActivity class MyMonitor: DeviceActivityMonitor {   let store = ManagedSettingsStore()   override func intervalDidStart(for activity: DeviceActivityName) {     super.intervalDidStart(for: activity)     let model = MyModel.shared     let applications = model.selectionToDiscourage.applicationTokens     let categories = model.selectionToDiscourage.categoryTokens     let webCategories = model.selectionToDiscourage.webDomainTokens          if applications.isEmpty {      print("No applications to restrict")     } else {      store.shield.applications = applications     }          if categories.isEmpty {      print("No categories to restrict")     } else {      store.shield.applicationCategories = ShieldSettings.ActivityCategoryPolicy.specific(categories, except: Set())     }          if webCategories.isEmpty {      print("No web categories to restrict")     } else {      store.shield.webDomains = webCategories     }     store.dateAndTime.requireAutomaticDateAndTime = true     store.account.lockAccounts = true     store.passcode.lockPasscode = true     store.siri.denySiri = true     store.appStore.denyInAppPurchases = true     store.appStore.maximumRating = 200     store.appStore.requirePasswordForPurchases = true     store.media.denyExplicitContent = true     store.gameCenter.denyMultiplayerGaming = true     store.media.denyMusicService = true     store.application.denyAppInstallation = true   }   override func intervalDidEnd(for activity: DeviceActivityName) {     super.intervalDidEnd(for: activity)     store.shield.applications = nil     store.shield.applicationCategories = nil     store.shield.webDomains = nil     store.dateAndTime.requireAutomaticDateAndTime = false     store.account.lockAccounts = false     store.passcode.lockPasscode = false     store.siri.denySiri = false     store.appStore.denyInAppPurchases = false     store.appStore.maximumRating = 1000     store.appStore.requirePasswordForPurchases = false     store.media.denyExplicitContent = false     store.gameCenter.denyMultiplayerGaming = false     store.media.denyMusicService = false     store.application.denyAppInstallation = false   } } import Foundation import FamilyControls import DeviceActivity import ManagedSettings class MyModel: ObservableObject {   static let shared = MyModel()   let store = ManagedSettingsStore()   private init() {}   var selectionToDiscourage = FamilyActivitySelection() {     willSet {       let applications = newValue.applicationTokens       let categories = newValue.categoryTokens       let webCategories = newValue.webDomainTokens       store.shield.applications = applications.isEmpty ? nil : applications       store.shield.applicationCategories = ShieldSettings.ActivityCategoryPolicy.specific(categories, except: Set())       store.shield.webDomains = webCategories      }   }   func initiateMonitoring(scheduleStart: DateComponents, scheduleEnd: DateComponents) {     let schedule = DeviceActivitySchedule(intervalStart: scheduleStart, intervalEnd: scheduleEnd, repeats: true, warningTime: nil)     print(scheduleStart)     print(scheduleEnd)     let center = DeviceActivityCenter()     do {       try center.startMonitoring(.daily, during: schedule)     }     catch {       print ("Could not start monitoring \(error)")     }          store.dateAndTime.requireAutomaticDateAndTime = false     store.account.lockAccounts = false     store.passcode.lockPasscode = false     store.siri.denySiri = false     store.appStore.denyInAppPurchases = false     store.appStore.maximumRating = 1000     store.appStore.requirePasswordForPurchases = false     store.media.denyExplicitContent = false     store.gameCenter.denyMultiplayerGaming = false     store.media.denyMusicService = false     store.application.denyAppInstallation = false   } } extension DeviceActivityName {   static let daily = Self("daily") } import SwiftUI import FamilyControls struct AppPicker: View {   @StateObject var model = MyModel.shared   @State var isPresented = false       var body: some View {     Button("Select Apps to Discourage") {       isPresented = true     }     .familyActivityPicker(isPresented: $isPresented, selection: $model.selectionToDiscourage)   } }
Posted
by
Post not yet marked as solved
2 Replies
2k Views
Hi, we are facing on a strange behaviour since iOS 16. In a registration view, we have two text field to insert password (password textfield and confirm password text field). Suggest strong password is abilitate (from iCloud... password & keychain). When user tap on password text field, can choose between strong password or text custom password. If user choose custom password, can text his own password as usually. But when he tap the second text field (confirm password) Apple fill in automatic both text field, cleaning the first text field... So user entry in a loop where he text password and when go next, previous textfield be cleaned and both text field filled with a new suggestion. Searching on the web we don't find any solution to it. Also because we try just to set text fields as .password or .newPassword. But this behaviour is always the same. Maybe is it a bug of iOS 16? How we can allow user to chose a custom password if the system fill always in automatic the password text fields, every time he tap on them?
Posted
by
Post not yet marked as solved
2 Replies
700 Views
currently when I try to set several schedules to the same activity the latest schedule I set is the only one I understand I can have only 1 schedule for activity. ? I thought about setting a new schedule on the intervalDidEnd but, I get no interval did start if the current time is in the middle of the interval I set For example, now it is 15:00, and my previous interval started at 14:00 and ends at 16:00 but the user sets a new interval from 14:30 - 16:40 I call the deviceActivityCenter.stopMonitoring([someActivityName]) and get noIntervalDidEnd event Then I set the new interval successfully with deviceActivityCenter.startMonitoring(someActivityName, during: deviceActivitySchedule) and get no intervalDidStartEvent So how can I achieve several intervals? If I had gotten the events of the start and end it would be possible Thanks for the help
Posted
by
Post not yet marked as solved
3 Replies
777 Views
Hi there, In rare cases (about 0.2% of the time?), I'm seeing calls to startMonitoring on an instance of DeviceActivityCenter throw an error with localizedDescription "couldn’t communicate with a helper application." I am certain I am passing valid parameters to the startMonitoring call because sometimes a naive retry after a few seconds succeeds. Similarly, I am certain that FamilyControls permissions have been granted by the user. Was hoping to get more color from the systems team on what some causes of this error are and if it is avoidable by the programmer.
Posted
by
Post not yet marked as solved
5 Replies
1.4k Views
Hi, I'm trying to make use of the Device Activity Labels where you supply an ApplicationToken. I can successfully get it to show the icon + title of the Application (twitter in my case) but I cannot get the styling to work. // Works .labelStyle(.iconOnly) .labelStyle(.titleOnly) .border(...) ![]("https://developer.apple.com/forums/content/attachment/9660b578-a36f-4d5a-ae18-653a207aa5ab" "title=Screenshot 2023-03-12 at 12.57.34 PM.png;width=1218;height=844") // Does NOT work .font(.largeTitle) .foregroundColor(.blue) I have checked the same style (or just modifiers) against a standard Label and they actually do work in the code below. // This is an application token. Some style not applied. Label(targetApp) .labelStyle(MyStyle()) // Showing the same style using a simple label. All styles correctly applied. Label("Twitter", systemImage: "video.square.fill") .labelStyle(MyStyle()) Is changing the font + color of the title for this Label(_ applicationToken:) supported?
Posted
by
Post not yet marked as solved
2 Replies
869 Views
Hi there, I'm presenting a FamilyActivityPicker inside of a sheet, and on some phones, the FamilyActivityPicker freezes and crashes when the user expands the "Other" category only. "Other" is the only category that exhibits this behavior, and it only does this on some phones, not in all cases. This issue is perfectly reproducible on those phones when using the FamilyActivityPicker for the "other" category only, but on those same phones it does not reproducible in the Native ScreenTime Picker in Settings → ScreenTime → App Limits → Add Limit. I don't have access to these phones as they are user reports, but any guidance here would be deeply appreciated. More broadly, there are several issues with the FamilyActivityPicker (categories expand on top of each other when multiple are opened, varying behavior with tapping rows vs tapping select bubbles depending on phone size, etc) that the Native ScreenTime Picker doesn't have. Grouping websites as a standalone category is preferable as well. Could we as developers just have access to that one?
Posted
by
Post marked as solved
1 Replies
1k Views
I am trying to test an app locally that has managed configurations, using the xcrun simctl command line tools. I am passing my config as a json array to the com.apple.configuration.managed but continually receive the error 'Could not parse: Try single-quoting it'. I have validated the json is correct. See redacted command below: xcrun simctl spawn booted defaults write com.app.bunleID com.apple.configuration.managed '{"apiKey":"xxxxxxxxx", "clientId":"xxxxxxxx", "clientSecret":"xxxxxxxx", "domainName":"xxxxxxx", "isPlaceOs":false}'
Posted
by
Post not yet marked as solved
2 Replies
709 Views
I want to deny deleting of my app. In the doc says that we can use: var denyAppRemoval: Bool? { get set } But it's doesn’t work. Example of applying: store.application.denyAppRemoval = true What I'm doing wrong? Should it work for .individual type of Family Control auth?
Post not yet marked as solved
1 Replies
767 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
by
Post not yet marked as solved
5 Replies
1.3k Views
Hi, I'm having trouble understanding what is the correct DateComponents format for the DeviceActivityCenter.startMonitoring to work as expected. Here's how it behaves with my setup: The schedule interval is set for 15 minutes (the minimum). On intervalDidStart I set the shields shield.applicationCategories = .all(except: exclCat) shield.webDomainCategories = .all(except: exclWeb) On intervalDidEnd I clear the settings shield.applicationCategories = nil shield.webDomainCategories = nil Different behavior with different DeviceActivitySchedule intervals. In the below examples I'll refer to hour, minute and second components as time components, and the calendar, timeZone, year, month, day, hour, minute and second components as date and time components. Also, with all combinations below no errors are thrown when calling the startMonitoring method. A. ❌ The start interval has time components, while the end interval has date and time components: The intervalDidStart is not triggered. DeviceActivitySchedule(schedule: <USDeviceActivitySchedule: 0x28354a5e0> IntervalStart: <NSDateComponents: 0x2839c7f40> { Hour: 9 Minute: 24 Second: 55 IntervalEnd: <NSDateComponents: 0x2839c7f70> { Calendar: <CFCalendar 0x2818f9090 [0x1e4fb1d10]>{identifier = 'gregorian'} TimeZone: Asia/Manila (GMT+8) offset 28800 Calendar Year: 2023 Month: 5 Leap Month: 0 Day: 15 Hour: 9 Minute: 39 Second: 55 Repeats: 0 WarningTime: (null)) B. ❌ The start interval has date and time components, while the end interval has time components: Here, the opposite of the above example happens — the intervalDidStart is triggered, but the intervalDidEnd is not. C. ❌ Both intervals have time components: The intervalDidStart is not triggered. D. ✅ Only hour, minute, and second components for both start and end intervals: Callbacks are called as expected. DeviceActivitySchedule(schedule: <USDeviceActivitySchedule: 0x282e80450> IntervalStart: <NSDateComponents: 0x2822f39f0> { Hour: 9 Minute: 12 Second: 15 IntervalEnd: <NSDateComponents: 0x2822f3a00> { Hour: 9 Minute: 27 Second: 15 Repeats: 0 WarningTime: (null)) So it seems that the correct and working version is with the time components only. However, from the documentation, the maximum schedule interval is a week. So if I need to set the schedule starting from a certain time of day A and ending in a certain time of day B, what should the DateComponents look like? Thanks for you help!
Posted
by
Post not yet marked as solved
1 Replies
776 Views
When using ManagedSettingsStore to shield apps, no system apps are shielded even when specifying all application categories. Here is my code: managedSettings.shield.applicationCategories = .all() Even when using the FamilyActivityPicker and selecting "All Apps & Categories" system apps like Messages do not get shielded. managedSettings.shield.applicationCategories = .specific(selectedCategories) I find this strange, since Messages exists inside the Social category, and is tracked fine using DeviceActivityMonitor. Why can't it be shielded using app categories? I'd like to be able to shield all apps, including Messages, without having the user to specifically select the apps using FamilyActivityPicker. Is that possible?
Posted
by
Post not yet marked as solved
3 Replies
1.5k Views
I created a ShieldConfigurationExtension in Xcode 14.3 with File > New > Target > ShieldConfigurationExtension. This created the extension with all the necessary Info.plist values (correct NSExtensionPrincipalClass, etc.), with the extension included in embedded content in the host app target. No matter what I try, the extension is not getting invoked when I shield applications from my host app. The custom UI does not show as the shield, and looking at the debugger, an extension process is never invoked. I am shielding categories like this: let managedSettings = ManagedSettingsStore() ... managedSettings.shield.applicationCategories = .all() And my extension code overrides all the ShieldConfigurationDataSource functions. class ShieldConfigurationExtension: ShieldConfigurationDataSource { override func configuration(shielding application: Application) -> ShieldConfiguration { return ShieldConfiguration( backgroundBlurStyle: UIBlurEffect.Style.systemThickMaterial, backgroundColor: UIColor.white, icon: UIImage(systemName: "stopwatch"), title: ShieldConfiguration.Label(text: "You are in a Present Session", color: .yellow) ) } override func configuration(shielding application: Application, in category: ActivityCategory) -> ShieldConfiguration { return ShieldConfiguration( backgroundBlurStyle: UIBlurEffect.Style.systemThickMaterial, backgroundColor: UIColor.white, icon: UIImage(systemName: "stopwatch"), title: ShieldConfiguration.Label(text: "You are in a Present Session", color: .yellow) ) } override func configuration(shielding webDomain: WebDomain) -> ShieldConfiguration { return ShieldConfiguration( backgroundBlurStyle: UIBlurEffect.Style.systemThickMaterial, backgroundColor: UIColor.white, icon: UIImage(systemName: "stopwatch"), title: ShieldConfiguration.Label(text: "You are in a Present Session", color: .yellow) ) } override func configuration(shielding webDomain: WebDomain, in category: ActivityCategory) -> ShieldConfiguration { return ShieldConfiguration( backgroundBlurStyle: UIBlurEffect.Style.systemThickMaterial, backgroundColor: UIColor.white, icon: UIImage(systemName: "stopwatch"), title: ShieldConfiguration.Label(text: "You are in a Present Session", color: .yellow) ) } } What am I missing?
Posted
by
Post not yet marked as solved
1 Replies
865 Views
I'm posting this here to bring attention to an issue we reported in July 2022 but haven't received any feedback on (FB10768388). Unfortunately, the issue still persists in iOS 16.5. When using the application.blockedApplications property of a ManagedSettingsStore to block apps, they disappear from the user's springboard as expected. However, when unblocking them, they only reappear in the App Library, which disrupts the organisation of the user's springboard if those apps were in folders or the dock. This renders the blockedApplications settings completely useless, forcing us to resort to shielding instead. We have received numerous complaints from users that their carefully crafted springboard organisation has been ruined by this issue 😅.
Posted
by