shielding and blocking apps

i'm trying to shield and block apps on child device.

i managed to block apps by creating a  variable blockedApps : Set = Set() that contains a list of applications like Application(bundleIdentifier: "com.apple.calculator") inside the intervalDidStart on my DeviceActivityMonitor extension

now i'm trying to shield an app using the same extension and nothing happens. for this i used this code inside intervalDidStart:

  let calculatorApp = Application(bundleIdentifier: "com.apple.calculator")     var blockedApps : Set = Set()           guard let token = calculatorApp.token else {       return     }     blockedApps = [token]     store.shield.applications = blockedApps

and i cant tell what is the reason for this not working

  1. is there a token issue that is nil?
  2. does shielding requires a different app extension?
  3. does my app extension requires some additional configuration maybe a different NSExtensionPointIdentifier?
Answered by vova085 in 693635022

played with this some more and answered my own questions:

  1. the token is unavailable/nil
  2. i managed to shield an app with the same extension used for blocking
  3. no my app extension does not require some additional configuration
Accepted Answer

played with this some more and answered my own questions:

  1. the token is unavailable/nil
  2. i managed to shield an app with the same extension used for blocking
  3. no my app extension does not require some additional configuration

Hi,

I am not able to call DeviceActivity callback methods to block apps, could you please share your code for Device Activity Extension or steps to create Device Activity extension.

shielding and blocking apps
 
 
Q