Sending screentime data to firebase then to accountability partner

Hey . So i'm building a screentime app whereby users can add an accountability partner who will be able to see their total screentime.(no app breakdowns included) .

This will require me to send the data to firebase realtime database and retrieve for the accountability partner to see. Problem is , I've literally tried everything but the screentime still shows 0m on the accountabiliy partner's end.

I need the data to be displayed rounded down to the nearest 0.5 e.g 1hr43mins ->1.5hrs+ ,2.0hrs+ ,3.5hrs+ , meaning it only moves when a threshold is crossed by the user. (this is to save database costs). Anyway i'd really appreciate if someone could help me out here. Thanks

@aishahhamman

By design and privacy concerns, you can't extract the device activity data. You can read the data and use it within the device activity target to perform actions needed for your app to function, so long as these actions do not involve storing or manipulating data collected by the service.

So i tried a different solution . It works 80% of the time but sometimes the value lags and idk why . I used deviceactivitymonitor extension to set thresholds every 30mins so when user's screentime reaches a certain value it fires.... so there's no saving or manipulating data . on the accountability partner's end they see 0.5hr+, 1.0hr+, 1.5hr+ etc . it updates only when the user crosses a registered threshold. Problem is sometimes it takes a while to fire ... it could lag for about an hour . eg if user screentime is 2hr43min it's still stuck on 1.5hr+ when it's supposed to be 2.5hrs+ . I don't know why this happens. Any ideas?

Sending screentime data to firebase then to accountability partner
 
 
Q