Post

Replies

Boosts

Views

Activity

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
1.9k
Dec ’22