Get Set<ApplicationToken> after shielded apps trough applicationCategories .all

To shield all app except a few, I did the next:

store.shield.applicationCategories = .all(except: exceptions)

After code above I can see that apps were successfully shielded.


Then I need to receive all app's tokens that were shielded on the previous step. To achieve that I do the next:

let applicationTokens = store.shield.applications

But always receive nil!


What should I do to get set of shielded apps which were blocked by applicationCategories?

The ManagedSettings store will only report back settings that you've set in it. So for example, if you set store.shield.applicationCategories = .all(except: exceptions), when you query store.shield.applicationCategories again, it'll return .all(except: exceptions). Similarly, if you don't set store.shield.application, when you query its value, it'll return nil as you haven't store anything for that setting.

Both the shield.applicationCategories and shield.applications are separate settings that work in tandem to allow authorized applications to shield apps. shield.applicationCategories lets the authorized application shield other applications based on their category with specific exceptions, whereas shield.applications allows it to shield specific applications instead of by category.

shield.applications is not meant to be used to query what apps are shielded on the device, it is a setting that allows your app to shield specific apps via ApplicationTokens the user has selected via a FamilyActivityPicker. shield.applicationCategories will also not report what apps are shielded via this setting, it'll only report what ActivityCategoryPolicy you've used to shield applications.

It is currently not possible to get the full list of apps that the ActivityCategoryPolicy affects. If you'd like to see this added to the API, please file a report via Feedback Assistant

Oh, thank you for the detailed explanation! Of course I'd like to see it. These things seems obvious for me, and I actually wondered why it weren't implemented before the API was released.

Is it real chance that Apple will implement it after report via Feedback Assistant?)

Get Set&lt;ApplicationToken&gt; after shielded apps trough applicationCategories .all
 
 
Q