Family Controls application-identifier Entitlement error while blocking an application

I was able to start the device activity monitor. I was able to see the Device Activity Monitor Extension as a process, and was able to attach to it via Xcode.

Now I am trying block a specific 3rd party application, via the Shield.

I am using this piece of code for intervalDidStart :

   override func intervalDidStart(for activity: DeviceActivityName) {
    NSLog("Interval started for Device Activity")
    let blockedApps : Set<Application> = [Application(bundleIdentifier: "com.facebook.Facebook")]
    store.application.blockedApplications = blockedApps
    super.intervalDidStart(for: activity)
}

I've declared store in the DeviceActivityMonitor class as follows :

   let store = ManagedSettingsStore()

This is the error I see in the Console:

Error Domain=UsageTrackingErrorDomain Code=1 "Something without a application-identifier entitlement tried to manage usage budgets" UserInfo={NSLocalizedDescription=Something without a application-identifier entitlement tried to manage usage budgets}

The above use case should work right? I should be able to apply the settings inside DeviceActivityMonitorExtension?

What does the application-identifier entitlement look like? How do I use it?

Please report this issue using Feedback Assistant.

Any progress with this issue?

can you please specify how you built the Device Activity Monitor Extension? xcode beta 2 doesn't have this kind of extension

Hi,

Any update on the above issue? I am also trying to block application in the same way but I am getting different error,

Attempts remaining: 1 Failed to fetch effective value for com.apple.ManagedSettings.effective-media-settings.changed: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.ManagedSettingsAgent was invalidated: failed at lookup with error 159 - Sandbox restriction." UserInfo={NSDebugDescription=The connection to service named com.apple.ManagedSettingsAgent was invalidated: failed at lookup with error 159 - Sandbox restriction.}``` could you please guide me if I'm missing something?

If you are getting the above error, it could be because of Family control capability is not added in extensions.

I am able to block the app with the above code, what I missed was Family control capability not added in Device Activity Monitor extensions.

Family Controls application-identifier Entitlement error while blocking an application
 
 
Q