[iOS 17] Screen Time connection breaks randomly multiple times per day

A few days ago, I upgraded my phone to iOS 17 and have since encountered a serious issue with my app, which heavily uses the Screen Time API.

Randomly throughout the day, the Screen Time connection breaks. As a result, all device activity reports turn up empty and the device activity center stops tracking activities. This problem doesn't only affect my app, but also all others that have Screen Time permissions on my phone. The only workaround I've found is to switch off and then switch on the Screen Time permission again.

This issue is clearly a significant concern for all developers working with the Screen Time API.

I've submitted a bug report (FB12332405), but I can't dig deeper into the problem because I'm stuck on this: https://developer.apple.com/forums/thread/731010.

Has anyone else come across this issue since upgrading to iOS 17?

We experience the same issue on our app, and we filled a bug report as well -> FB12235755.

The issue seems to happen when screentime permission have been granted prior to iOS 17. In our testing, everything based on DeviceActivityReport fails to render until you reinstall the app. here's what we see in the logs:

Failed to discover the client's extension: Error Domain=DeviceActivityReportService.ReportViewController.ClientError Code=2 "(null)" VS terminated with error: Error Domain=_UIViewServiceErrorDomain Code=1 "(null)" UserInfo={Terminated=disconnect method}

I agree this is a big concern for us as well, we don't want to ask all of our users to reinstall the app after updating to iOS 17.

This is also showing how little control we have on DeviceActivityReport views, we cannot know if they are loading, if they errored with the public API, we opened a enhancement radar on this about a year ago (FB10754858).

+1 (thank you Thomas for being on top of this!)

I had a user bug report of this happening where permissions are 'randomly' lost so DeviceActivityCenter scheduling starts returning errors as if there are no permissions.

Radar here with some details (if more is needed, happy to help): FB12364989

Same issues here. It seems there hasn't been a solution yet? Getting "Failed to discover the client's extension: Error Domain=DeviceActivityReportService.ReportViewController.ClientError Code=2 "(null)" when just trying to render the view on my iOS 17 iPhone, and the DeviceActivityReport View is rendering.

[iOS 17] Screen Time connection breaks randomly multiple times per day
 
 
Q