Screen Time API

Hi everyone,

I've been going through the forums and documentation, but I'm still unsure about how the Screen Time API works or whether it can achieve what I have in mind.

Specifically, I want to display the current screen time value on a widget. Additionally, I’d like to use that screen time value for some calculations and represent the results in a different way within the widget.

I’d really appreciate any guidance or insights. Thanks in advance! 😊

Answered by Engineer in 817658022

Widgets are designed to show glanceable information. It might be hard to keep it up to date without hitting your 72 refreshes per day limit. Widgets are driven by manual reloads, notification based reloads and / or on device timelines. Your timeline can at best refresh once every 20 minutes without explicit interaction via an App Intent. If you are showing a countdown to a date when some time period expires, that would only require a refresh when that expiration time expires, which may be easier to maintain than showing current usage.

Note you will need app groups to share the information with your Widget.

Rico


WWDR | DTS | Software Engineer

Accepted Answer

Widgets are designed to show glanceable information. It might be hard to keep it up to date without hitting your 72 refreshes per day limit. Widgets are driven by manual reloads, notification based reloads and / or on device timelines. Your timeline can at best refresh once every 20 minutes without explicit interaction via an App Intent. If you are showing a countdown to a date when some time period expires, that would only require a refresh when that expiration time expires, which may be easier to maintain than showing current usage.

Note you will need app groups to share the information with your Widget.

Rico


WWDR | DTS | Software Engineer

Screen Time API
 
 
Q