DeviceActivityReport not showing report data to main app

I am getting this error when I try to show device activity report view by this DeviceActivityReport(appsContext, filter: filter)

Attempt to map database failed: permission was denied. This attempt will not be retried.

I have taken access by this way. AuthorizationCenter.shared.requestAuthorization(for: .individual)

Where are you trying to show the report? This is a launch services error and should just work if permission was granted in your main app.

I am getting the exact same error!

Not sure how I am failing to grant permission in my main app as well. I even checked with print statements in my code to see if the Screen Time Authorization status was approved like this -

print("Screen Time Authorization Status (authorizationStatus)")

This was the full error when I attempted to run DeviceActivityReport(appsConext, filter: filter) --

LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=68, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler}

Attempt to map database failed: permission was denied. This attempt will not be retried.

Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=68, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler}

DeviceActivityReport not showing report data to main app
 
 
Q