FamilyActivityPicker | Screen Time API | iOS 16

Hi folks!

Is it possible using FamilyActivityPicker choose which apps will be allowed instead of which apps to restrict?

Thank you in advance!

Answered by Frameworks Engineer in 733379022

Yes! The FamilyActivityPicker only generates tokens based on a users selections, but what you do with those tokens is completely up to you. For example, if you want to shield all apps except the apps selected in the picker, you can do the following:

let store = ManagedSettingsStore()
store.shield.applicationCategories = .all(except: familyActivitySelection.applicationTokens)

where familyActivitySelection is the FamilyActivitySelection returned from a FamilyActivityPicker

Accepted Answer

Yes! The FamilyActivityPicker only generates tokens based on a users selections, but what you do with those tokens is completely up to you. For example, if you want to shield all apps except the apps selected in the picker, you can do the following:

let store = ManagedSettingsStore()
store.shield.applicationCategories = .all(except: familyActivitySelection.applicationTokens)

where familyActivitySelection is the FamilyActivitySelection returned from a FamilyActivityPicker

FamilyActivityPicker | Screen Time API | iOS 16
 
 
Q