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

107 Posts
Sort by:
Post not yet marked as solved
0 Replies
414 Views
Any way that I try requesting authorization for family controls is incredibly inconsistent. The line of code that hangs is **let center = AuthorizationCenter.shared ** I've looked at other posts and I saw someone recommended declaring let center = AuthorizationCenter.shared outside the main thread and somehow get the status on the main thread. I've tried that approach with no success. I've scoured GitHub to see how other people approach the request but it's all pretty similar. The following code sometimes works great for a few minutes and then I rebuild and run and it hangs on AuthorizationCenter.shared.requestAuthorization(for: FamilyControlsMember.individual). Would love any suggestions!!! .onAppear { Task { do { print("try requestAuthorization") try await AuthorizationCenter.shared.requestAuthorization(for: FamilyControlsMember.individual) print("requestAuthorization success") switch AuthorizationCenter.shared.authorizationStatus { case .notDetermined: print("not determined") case .denied: print("denied") case .approved: print("approved") @unknown default: break } } catch { print("Error requestAuthorization: ", error) } } }
Posted
by
Post not yet marked as solved
0 Replies
293 Views
I have gained the PassKit access, but don't know how to configure com. Apple. Developer. PassKit. Pass the presentation - suppression the permissions. Who can tell us the detailed process, which Capabilities should be configured in the App ID?
Posted
by
Post not yet marked as solved
0 Replies
430 Views
DL;DR: Sometimes the API fails to unblock the app and leaves an hourglass shield on the restricted apps, which is not set by us. Even worse, if we remove authorization of our app from Settings, the restricted apps remain locked until we restart the phone or re-run our app from Xcode. Our app monitors the usage of selected apps from the current time until the reset time at 4:00 a.m. When the given threshold is reached, the selected apps are shielded. After the user taps the close button on the shield view, we attempt to remove the shield, set up a new threshold monitoring and close the app. The issue is that: sometimes the shield removal fails, and after the app closes itself, it remains shielded, and displays an hourglass shield view that was never in our shield configuration. Additionally, regardless of what we do-removing the shielding from our apps or removing the authorization of our app from Settings, the restricted apps remain shielded until we restart the phone or re-run our app from Xcode. Code I use for un-shielding: warningUsageStore.clearAllSettings() Code I use for scheduling the threshold: var warningMinute = userDefaults.integer(forKey: .warningMinute) if warningMinute <= 0 { warningMinute = 5 } let selection = familyActivitySelection() let now = Date.now let start = Calendar.current.dateComponents([.hour, .minute, .second], from: now) var end = AppConfig.resetEndTime // use twenty minutes later as the end time if the before reset time is too near e.g. warning start at 3:55 but reset time is 4:00 if let endDate = Calendar.current.nextDate(after: now, matching: end, matchingPolicy: .nextTime), endDate.timeIntervalSince(now) <= 15*60 { end = Calendar.current.dateComponents([.hour, .minute, .second], from: now.addingTimeInterval(20*60)) } // add inidividual event according to the hash value to dintinguish between apps. var events = [DeviceActivityEvent.Name : DeviceActivityEvent]() for application in selection.applications where application.token != nil { events[.init(application.hashValue.description)] = .init(applications: [application.token!], threshold: .init(minute: warningMinute)) } for category in selection.categories where category.token != nil { events[.init(category.hashValue.description)] = .init(categories: [category.token!], threshold: .init(minute: warningMinute)) } for webDomain in selection.webDomains where webDomain.token != nil { events[.init(webDomain.hashValue.description)] = .init(webDomains: [webDomain.token!], threshold: .init(minute: warningMinute)) } try deviceActivityCenter.startMonitoring(.usageWarning, during: .init(intervalStart: start, intervalEnd: end, repeats: false), events: events) The issue happens on my iPhone11 iOS17.1.2 Any insight would be much appreciated. Thank you!
Posted
by
Post not yet marked as solved
3 Replies
704 Views
Hello, I wasn't able to figure out how to handle multiple days with DeviceActivitySchedule. For instance, let's say the user wants to block certain apps from 9:00 AM to 12:00 AM, every day except Saturday and Sunday, how my schedule should look like? I've tried different things... This schedule works for each day of the week, but that's not my goal: let schedule = DeviceActivitySchedule( intervalStart: DateComponents(hour: 9, minute: 00), intervalEnd: DateComponents(hour: 12, minute: 00), repeats: true) And if I specify the weekDay inside the DateComponents, like this: // Gregorian calendar // 2 -> Monday // 6 -> Friday let schedule = DeviceActivitySchedule( intervalStart: DateComponents(..., weekday: 2), intervalEnd: DateComponents(..., weekday: 6), repeats: true) the schedule will block the apps from Monday at 9:00 AM to Friday at 12:00 AM, which is also not my goal. The only workaround that came to my mind was to create a different schedule for each day of the week: enum WeekDays: String, CaseIterable { case sun, mon, tue, wed, thu, fri, sat var sortOrder: Int { switch self { case .sun: return 1 case .mon: return 2 case .tue: return 3 case .wed: return 4 case .thu: return 5 case .fri: return 6 case .sat: return 7 } } } func startMonitoring(weekDays: [WeekDays]) { for weekDay in weekDays { let day = weekDay.sortOrder let schedule = DeviceActivitySchedule( intervalStart: DateComponents( hour: 9, minute: 00, weekday: day), intervalEnd: DateComponents( hour: 12, minute: 00, weekday: day), repeats: true) let activityName = DeviceActivityName(weekDay.rawValue) do { try center.startMonitoring(activityName, during: schedule) } catch { print("DEBUG: Error: \(error.localizedDescription)") } } } This way I kinda get what I want, for example: I can specify 3 days of the week, let's say Monday, Tuesday and Wednesday, the time interval, let's keep 9:00 AM - 12:00 AM, and this function will block apps on Monday, Tuesday and Wednesday at that time interval, fine. However... What if I also want another schedule that blocks at a different time interval but same day? For example, I want to block certain apps Monday and Tuesday from 2:00 PM - 6:00 PM. Following the example above the activityName would be overwritten, so the user ( for Monday and Tuesday ) would now have only the schedules that starts from 2:00 PM. Basically, I want the user to be able to select multiple days for a schedule and to let them create as many schedules as they want. Does anybody know the correct way to handle multiple days schedules?
Posted
by
Post not yet marked as solved
1 Replies
575 Views
Hello, I'm currently experiencing an issue with the DeviceActivityMonitor extension in my code, specifically with the eventDidReachThreshold callback. I'm hoping to get some insights into why this problem occurs and how to resolve it. Problem: Issue 1: The eventDidReachThreshold callback is not triggering as expected. It appears that the callback is not being invoked when the threshold is reached. Issue 2: After a few seconds, the eventDidReachThreshold callback starts to trigger multiple times. This unexpected behavior is causing problems in my code, as it results in incorrect actions being taken. Issue 3: There are instances where the eventDidReachThreshold callback provides an incorrect event name. iOS version: iOS16.7.2 and iOS17.1.1 Here is my code to start the monitoring: func startMonitoring() { var startTime : DateComponents = DateComponents(hour: 0, minute: 0) let endTime : DateComponents = DateComponents(hour: 23, minute: 59) /// Creates the schedule for the activity, specifying the start and end times, and setting it to repeat. let schedule = DeviceActivitySchedule(intervalStart: startTime, intervalEnd: endTime, repeats: true, warningTime: nil) /// Defines the event that should trigger the encouragement. let event = DeviceActivityEvent(applications: socialActivitySelection.applicationTokens, categories: socialActivitySelection.categoryTokens, webDomains: socialActivitySelection.webDomainTokens, threshold: DateComponents(minute: 2)) let events: [DeviceActivityEvent.Name: DeviceActivityEvent] = [.socialScreenTimeEvent : event] do { activityCenter.stopMonitoring([.socialScreenTime]) /// Tries to start monitoring the activity using the specified schedule and events. try activityCenter.startMonitoring(.socialScreenTime, during: schedule, events: events) } catch { /// Prints an error message if the activity could not be started. print("Could not start monitoring: \(error)") } } In addition, I should mention that, with each iteration through the eventDidReachThreshold callback, I increment the threshold by 2 minutes and restart the monitoring. If there are any known workarounds or potential solutions, please share them. Thank you.
Posted
by
Post not yet marked as solved
0 Replies
460 Views
My app uses DeviceActivitySchedule to let users set schedules to block certain apps. I naturally want to understand how my users are using the feature, so I capture analytics events using Segment. Ever since the release of iOS 17.1, analytics events from DeviceActivityMonitor have stopped firing. I believe this is due to the fact that the app extension that DeviceActivityMonitor runs in does not support asynchronous network requests. (However, I'm not sure why the analytics were working correctly with iOS 16). What is the best way to capture analytics inside the DeviceActivityMonitor app extension in iOS 17?
Posted
by
Post not yet marked as solved
1 Replies
387 Views
Are there published limits for how many concurrent ManagedSettingsStore our apps can have going at once? More importantly, is there a way for our app to retrieve all the ManagedSettingStore.Name that are already applied by our app? (Not system wide, just our app). DeviceActivityCenter().activities fetches all the DeviceActivityName that are being monitored actively. Is there something similar?
Posted
by
Post not yet marked as solved
3 Replies
880 Views
My app sends screen time awareness notifications based on DeviceActivityMonitor thresholds. Often, users receive two notifications in a row for the same screen time threshold. This means that the app extension is triggering the same eventDidReachThreshold callback function twice for the same threshold. I've made sure that there is only one activity schedule being monitored. This happens often, but not every time (over 50% of the time). Anybody else experience this issue, and any way to mitigate it?
Posted
by
Post not yet marked as solved
1 Replies
549 Views
Having trouble in signing in to iCloud when a managed supervised iPhone is restricted with few apps using “allowListedAppBundleIDs” restrictions key. Only iPhone has this trouble, this issue is not reproducible in iPad. Even after entering the Apple ID and password, the account seems to be not logged in. Have attached screenshots for reference. Tested device iOS Version : 17.1 Kindly explain this behaviour. Feedback ID : #FB13318247 - Sysdiagnose logs attached here.
Posted
by
Post not yet marked as solved
0 Replies
313 Views
My company has recently finalized a contract with another company that had 2FA enabled for one of our email accounts associated with our PlayStore developer account. Regrettably, we have lost contact with this company and now require the modification of the 2FA currently registered on their phone. How do I get in contact directly with a person from apples support?
Posted
by
Post not yet marked as solved
2 Replies
375 Views
I have been unable to get ANY Apple Developer support today. The phone number I had connected to my business Apple Developer account is changed and it seems the only way that the Apple website can authenticate is by THAT number and does not even offer email as an alternative solution to login and change my phone number. Nobody at Apple Support can connect me to a single Apple Developer contact and NOBODY seems capable of solving this problem. Why pay for this developer platform if there isn't any support?
Posted
by
Post not yet marked as solved
0 Replies
411 Views
We are making an appstore app to be opened in single app kiosk mode(App Lock Policy for a single app) . When tried to open and login , a popup which is seen when opened without kiosk mode is not opening up. Attached the screenshot of the popup screen. (not able to attach the video here) Raised Feedback id - FB13304240 AppLock Policy Payload sent to the device : <dict> <key>PayloadVersion</key> <integer>1</integer> <key>PayloadUUID</key> <string></string> <key>PayloadType</key> <string>Configuration</string> <key>PayloadOrganization</key> <string>fhd</string> <key>PayloadIdentifier</key> <string>sample_id</string> <key>PayloadDisplayName</key> <string>Kiosk Zenoti</string> <key>PayloadRemovalDisallowed</key> <true/> <key>PayloadContent</key> <array> <dict> <key>PayloadVersion</key> <integer>1</integer> <key>PayloadUUID</key> <string>ad18a938-211e-4670-9be6-6f43162b6290</string> <key>PayloadType</key> <string>com.apple.app.lock</string> <key>PayloadOrganization</key> <string>MDM</string> <key>PayloadIdentifier</key> <string>a � �d18a938-211e-4670-9be6-6f43162b6290</string> <key>PayloadDisplayName</key> <string>AppLock Policy</string> <key>App</key> <dict> <key>Options</key> <dict> <key>DisableTouch</key> <false/> <key>DisableDeviceRotation</key> <false/> <key>DisableVolumeButtons</key> <false/> <key>DisableRingerSwitch</key> <false/> <key>DisableSleepWakeButton</key> <false/> <key>DisableAutoLock</key> <true/> <key>EnableVoiceOver</key> <false/> <key>EnableZoom</key> <false/> <key>EnableInvertColors</key> <false/> <key>EnableAssistiveTouch</key> <false/> <key>EnableSpeakSelection</key> <false/> <key>EnableMonoAudio</key> <false/> <key>EnableVoiceControl</key> <false/> </dict> <key>UserEnabledOptions</key> <dict> <key>VoiceOver</key> <false/> <key>Zoom</key> <false/> <key>InvertColors</ke � y> <false/> <key>AssistiveTouch</key> <false/> </dict> <key>Identifier</key> <string>com.zenoti.mpos</string> </dict> <key>Identifier</key> <string>com.zenoti.mpos</string> </dict> </array> </dict> </plist>
Posted
by
Post not yet marked as solved
0 Replies
347 Views
ShieldActionDelegate called .secondaryButtonPressed with secondaryButtonLabel == nil. Step to reproduce: Make configure ShieldConfiguration with primaryButtonLabel configure only. Add some method (in my case I add unblock all) in ShieldActionDelegate by case .secondaryButtonPressed On Shield make a few taps on secondary button area see attached image handle(action: ShieldAction, for application: ApplicationToken ... for case .secondaryButtonPressed called - it's wrong, I don't have second button configured, but action is called. Added feedback: 13254523
Posted
by
Post not yet marked as solved
1 Replies
377 Views
We are developing an application that utilizes the Screen Time API. As outlined in Apple's documentation on family controls(https://developer.apple.com/documentation/familycontrols/), we are obtaining authorization as follows: Task(priority: .high) {                 do {                     try await AuthorizationCenter.shared.requestAuthorization(for: .child)                     NSLog("Authorization State ~ AUTHORIZED")                 }catch let error {                     NSLog("Authorization ERROR: \(error.localizedDescription)")                 }             } As mentioned in the documentation, once the app is authorized for family controls, the user should not be able to delete the app without giving the parent iCloud credentials. When deleting the app, the prompt for entering the parent iCloud credentials is shown sometimes and in some unknown cases, the prompt is not shown and the app is deleted without requiring the parent’s iCloud account.
Posted
by
Post not yet marked as solved
0 Replies
357 Views
If a user has Screen Time limits set up for certain apps, will that interfere with my app that allows users to restrict app usage using the Screen Time API? I've had some users experiencing this issue (they have Screen Time limits set up for apps, and my app isn't able to restrict those and/or other apps), but I haven't been able to find a reliable pattern yet. Has anyone else encountered this?
Posted
by
Post not yet marked as solved
8 Replies
1.2k Views
Hello Apple Developer Community, We're experiencing a critical issue with the Screen Time frameworks, and it's affecting one of our users severely. I'm hoping someone here can provide guidance or a potential solution. Details: Our app offers a feature using the ManagedSettings shield that lets users block all apps based on a set schedule. After the scheduled block ends, the apps are expected to become accessible again. In one case, a user reported that the apps did not unblock after the schedule ended. Upon trying to manually end the session from within our app, the app only displays a blank white screen. The user attempted to disable Screen Time access for our app via the iOS settings, but the apps remained blocked. Even after completely disabling Screen Time from the settings or restarting the phone, the apps stayed blocked. Interestingly, I attempted to replicate the issue on my end by toggling Screen Time settings and restarting, but everything worked as expected and I could not reproduce the problem. This issue, though seemingly isolated, has rendered a user's phone virtually unusable, and highlights a potential high-impact bug within the Screen Time framework. It feels necessary for there to be a "master off-switch" or a fail-safe mechanism in these scenarios. Any insights, solutions, or workarounds would be deeply appreciated. It's crucial for us to support our user and resolve this promptly. Thank you in advance!
Posted
by
Post not yet marked as solved
3 Replies
662 Views
Hello, I am curious if someone else also noticed this. We have started getting reports about our app not working correctly (mostly related to the Device Activity monitor that "runs" in the background, https://developer.apple.com/documentation/deviceactivity/deviceactivitymonitor). Upon checking the Xcode Organizer I can see somewhat significant amount of crashes that mostly appear to happen on iOS 16.6 - it is possible that our users don't wait with updating iOS but still looks suspicious. The crashes are related to ManagedSettings calls outside our own code. We haven't changes this code in a while so this coupled with the fact that these crashes happen "deep" in the ManagedSettings framework leads me to believe there is some other issue.
Posted
by
Post not yet marked as solved
3 Replies
763 Views
Hello! I'm new to iOS development and am developing an app that blocks certain websites. At the moment, I'm thinking of using the Network Extension capability to do the job. From what I have read, in the production version of the app, you'd need to make use of MDM profiles since NE filtering only works on supervised devices. So, I'm here to ask the community if there are better options than using this method. As far as screen time api is concerned, I believe it requires the user to specify which websites they want blocked by themselves using the activity picker so that doesn't quite work for me since i want to allow the app to block groups of websites by itself based on the user's preference. Thanks!
Posted
by
Post not yet marked as solved
0 Replies
377 Views
Hello, I have a mobile game company, but the account where we uploaded the games was closed due to non-payment and we did not renew the domain of our mail. Is there any chance I can recover the account? If I recover it, will the games be deleted?
Posted
by