FamilyActivitySelection | Screen Time API features iOS 16

How to store at one time more than one app while selection from FamilyActivityPicker?

.familyActivityPicker(
    isPresented: $isDiscouragedPresented,
    selection: $model.selectionToDiscourage
)

The code above save only one token. If user select more than one app the FamilyActivitySelection.applicationTokens becomes empty [], but if select only one app, applicationTokens will contain one token from selected app.

Hi, I have the same question. Thanks in advance for the answer!

Strange behaviour of selecting multiple apps or category...

  • for some category (Productivity) I'm able to block all apps
  • for other category (Entertainment) when I select whole category, there are some apps blocked and some not
  • for third category (Social) if select all apps, none of them will be blocked

Why it's happening?

Accepted Answer

I'm not sure exactly what is happening here, but if you choose all the apps in one category, then the behavior I've seen is that you get a selection for the category, but no selection for the apps in that category.

There's a property that seems to control this:

https://developer.apple.com/documentation/familycontrols/familyactivityselection/init(includeentirecategory:)

Maybe you should set that to true when creating your FamilyActivitySelection?

If you're seeing surprising FamilyActivitySelection results when selecting more than 1 (but not all) of the apps in a category, then I recommend you file a bug report via Feedback Assistant and reply here with the feedback number.

Despite the link is broken, it helped. Thank you!

FamilyActivitySelection | Screen Time API features iOS 16
 
 
Q