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?

accountability partner who will be able to see their total screentime

Hello @aishahhamman!

I believe what you are describing is unfortunately not in conformance with Apple’s App Store guidelines:

To use the Family Controls Framework, Your Application must have a primary purpose of (1) offering family controls for parents and guardians, through Family Sharing, to supervise their children’s app usage; and/or (2) offering individuals the ability to manage their devices to enable focus and productivity through focus controls, timers and task management, or personal device usage management. The Family Controls Framework may not be used for other purposes, such as ad blocking, in organizational settings, or for managing the device of another adult individual. Device or usage data received through the Family Controls Framework may only be used for providing family controls, or individual device management. You and Your Application may not share device or usage data received through the Family Controls Framework or otherwise, beyond the family controls You provide, or the individual and their device, respectively. You may not use or share such device or usage data for purposes of advertising or advertising measurements, or share device or usage data with a data broker.

Source: https://developer.apple.com/support/terms/apple-developer-program-license-agreement/

Hope that helps!

Sending screentime data to firebase then to accountability partner
 
 
Q