Post

Replies

Boosts

Views

Activity

Comment on shielding and blocking apps
create a new extension (i chose call directory extension but maybe at the time you read this there will be an extension for activity monitor) int the info pList of the extension set the NSExtensionPointIdentifier key to be com.apple.deviceactivity.monitor-extension go to the swift file that was created (will be called CallDirectoryHandler if you chose a call directory extension ) and make it implement the DeviceActivityMonitor protocol you can change the name of this class if you want set the NSExtensionPrincipalClass inside the pList to the name of the class that implementing DeviceActivityMonitor protocol add the override methods you want (the most relevant ones are: intervalDidEnd and intervalDidStart. see example at the end of the message) call the DeviceActivityCenter start monitor on you APP Not the Extension with the needed parameter (you can see that on the tutorial of this api) example overridden methods:    override func intervalDidStart(for activity: DeviceActivityName) {       super.intervalDidStart(for: activity)   }       override func intervalDidEnd(for activity: DeviceActivityName) {     super.intervalDidEnd(for: activity)   }
Nov ’21