[iOS 18 Beta 2] Already monitored device activities need to be manually stopped before being restarted

Since iOS 18 Seed 2, I've noticed an issue. When calling startMonitoring(_:during:events:) with an already monitored activity, intervalDidStart in the Device Activity Monitor extension isn't triggered as it should be.

I have to manually call stopMonitoring(_:) BEFORE restarting the activity for intervalDidStart to be called. This is 100% reproducible.

This is different from how it worked before iOS 18 Seed 2 and contradicts the official documentation, which says, “If the app already monitored the activity, this method overwrites the previous schedule and events.” IMO, this suggests we shouldn't have to stop the activity manually; the startMonitoring(_:during:events:) method should handle it automatically.

Is this a mistake or intended behavior?

If intended:

  • Could you give us the reason?
  • The documentation should be updated to reflect this change.

I've already filed a feedback about this issue (FB14110789).

Filed a similar bug here: FB14187336

What is your start time stamp of the new activity monitor? Is it in the past? or current time? or future?

[iOS 18 Beta 2] Already monitored device activities need to be manually stopped before being restarted
 
 
Q