DeviceActivityMonitor extension does not call back at the set time

Hello Apple development team, I have developed an App for screen time management, which mainly uses ScreenTimeAPI. Users can set certain Apps to be disabled during a certain period of time.

After the App is released, users often report that the settings do not take effect as expected. I have seen many developers on the forum reporting that the DeviceActivityMonitor extension sometimes does not trigger callbacks. Based on this background, I have the following questions:

  1. Is it a known problem that the DeviceActivityMonitor extension sometimes does not trigger callbacks? If so, are there any means to avoid or reduce the probability of occurrence?

  2. In addition to being killed by the system when the running memory exceeds (I just called some ScreenTimeAPI and accessed UserDefaults in the extension, which should not exceed the running memory), under what other circumstances will the DeviceActivityMonitor extension be killed by the system? Will it automatically recover after being killed? Will some callbacks be called when killing?

  3. Does ManagedSettingsStore have a life cycle? How do you avoid conflicts when configuring the underlying operating mechanism of multiple stores?

This is a random problem. I have never encountered it during development and debugging, but users often report it.

thanks

Hi,

  1. Please provide more information about not calling back and you specific situation.
  2. Any process on the system can be killed when using too much memory or idle too long. The service should restart the next time you request information.
  3. Lifecycles apply to views, so not exactly. Avoiding conflicts is the job of the framework itself so you shouldn't need to do anything special to make it all work.
DeviceActivityMonitor extension does not call back at the set time
 
 
Q