Search results for

DeviceActivityMonitor

127 results found

Post

Replies

Boosts

Views

Activity

How to designate principal class
I am building an app that uses DeviceActivity framework. Looking at the documentation, I need to subclass (https://developer.apple.com/documentation/deviceactivity/deviceactivitymonitor), I need to subclass DeviceActivityMonitor and designate the subclass as the principal class of my app extension. I am wondering how to designate my subclass as the principal class. (I am new to iOS development :) .
2
0
1.1k
Aug ’21
Reply to Is the Screen Time API completely broken in the betas?
i have created an extension and changed the identifier to com.apple.deviceactivity.monitor-extension i subclassed DeviceActivityMonitor in my class and designated it as the principal class of my app extension but non of the methods doesn't get called when trying to monitor an activity what method will trigger the extension? is it center.startMonitoring(activity, during: schedule) in that case why non of my extension DeviceActivityMonitor methods doesn't gets called? why calling requestAuthorization on parent device always fails? can anyone upload some sample code that actually do something?
Topic: App & System Services SubTopic: General Tags:
Aug ’21
Reply to Is the Screen Time API completely broken in the betas?
FamilyActivityPicker does not list installed apps on either of the guardian's or child's devices, it only lists the categories. It's not clear at this point whether FamilyActivityPicker needs to be called on the parent or the child device. The apps are now shown in the app running on the child device. They are not shown on the parent device. After successfully authorizing a child device via AuthorizationCenter.shared.requestAuthorization, DeviceActivityCenter.startMonitoring always results in an MonitoringError.unauthorized error. This appears to have been fixed. Even though an app is authorized to managed ScreenTime on a child device, the child can always just delete the app. This is fixed, parental sign-in is now required to delete the app. The DeviceActivityMonitor extension is launched at the start of the interval, so that's good as well. But there's still the critical issue where the parent app cannot list and set restricted apps installed on the child device. I'm still wondering whether the par
Topic: App & System Services SubTopic: General Tags:
Jul ’21
DeviceActivityMonitor startMonitoring error
I created my Device Activity Monitor extension, and then attempted to start monitoring using the code example from the video: let schedule = DeviceActivitySchedule( intervalStart: DateComponents(hour: 0, minute: 0), intervalEnd: DateComponents(hour: 23, minute: 59), repeats: true ) let center = DeviceActivityCenter() do { try center.startMonitoring(.daily, during: schedule) } catch { print(error) } The startMonitoring call always fails for me with the same error: [monitor] Failed to create UsageTrackingAgent proxy: Error Domain=NSCocoaErrorDomain Code=4099 The connection to service on pid 0 named com.apple.UsageTrackingAgent was invalidated. UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.UsageTrackingAgent was invalidated.} Setting up the extension is a very manual process, so I likely missed a step somewhere, but any ideas on what this error might be indicating?
2
0
1.8k
Jul ’21
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(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
6
0
3.1k
Jun ’21