loopandlearn / LoopFollow

A general Follow app for parents of T1D Loop Users
GNU Affero General Public License v3.0
100 stars 502 forks source link

Widget #37

Open jonfawcett opened 4 years ago

jonfawcett commented 4 years ago

Today widget for iOS 13 and home screen widgets for iOS 14

mikebash commented 3 years ago

I've thought about this as well as it would be pretty handy. In doing a little reading, the refresh rate may be a hurdle to provide updated info as frequently as we'd like.

https://developer.apple.com/documentation/widgetkit/keeping-a-widget-up-to-date

To manage system load, WidgetKit uses a budget to distribute widget reloads over the course of the day. The budget allocation is dynamic and takes many factors into account, including:

The frequency and times the widget is visible to the user. The widget’s last reload time. Whether the widget’s containing app is active.

A widget’s budget applies to a 24-hour period. WidgetKit tunes the 24-hour window to the user’s daily usage pattern, which means the daily budget doesn’t necessarily reset at exactly midnight. For a widget the user frequently views, a daily budget typically includes from 40 to 70 refreshes. This rate roughly translates to widget reloads every 15 to 60 minutes, but it’s common for these intervals to vary due to the many factors involved.

Perhaps though there are ways to ensure the widget is always up to date when the viewer looks at it (and doesn't update when not viewed - hence the 40-70 refreshes per day).