ManagedSettings can't shield Messages and other system apps

When using ManagedSettingsStore to shield apps, no system apps are shielded even when specifying all application categories. Here is my code:

managedSettings.shield.applicationCategories = .all()

Even when using the FamilyActivityPicker and selecting "All Apps & Categories" system apps like Messages do not get shielded.

managedSettings.shield.applicationCategories = .specific(selectedCategories)

I find this strange, since Messages exists inside the Social category, and is tracked fine using DeviceActivityMonitor. Why can't it be shielded using app categories?

I'd like to be able to shield all apps, including Messages, without having the user to specifically select the apps using FamilyActivityPicker. Is that possible?

Replies

As you discovered, managedSettings.shield.applicationCategories = .all() shields most but not all apps.

Messages can be shielded using .all however you need to remove it from "Always Allowed" in System Settings/Screen Time.

Also what's interesting behavior is if an app is in Always Allowed, it will never be shielded using a category shield. However, if the app is directly selected and shielded, then regardless of it being in the Always Allowed, it can be shielded.

Programmatically selecting apps to shield isn't currently an option as tokens are only generated when apps are selected in the picker. Apple should allow developers to add apps to shield via their bundleID while still keeping privacy. The API would just silently fail for any apps not installed on a device so a developer could just have a list of ID's to shield for a given situations in their apps. Also want this for categories so we could shield all games without users having to pick "games" in the picker.

I've filed enhancement requests with feedback assistant about giving more functionality in shielding all, adding apps programmatically, etc. I recommend you do so too so that Apple gives developers more control over all of this.

  • Hi CaliforninaJay. Could you kindly elaborate on this part below?

    However, if the app is directly selected and shielded, then regardless of it being in the Always Allowed, it can be shielded.

    What do you mean by "directly select and shield"? Are you referring to users selecting certain apps on the Picker? I tried this but couldn't supercede the Always Alllowed.

  • Sorry, I think I've solved it on my own:)

  • Glad you got it! Just to clarify… by directly selected I meant a user selecting it in the family activity picker. If that isn’t working, then (at least as of iOS 16.4) it is probably something in your code.

Add a Comment