WidgetCenter.reloadTimelines allowed frequency?

I'm writing a widget for a music app. The widget is similar to the Apple Music app's Recently Played widget. I want to call WidgetCenter.reloadTimelines when the currently played song changes, so that the widget refreshes to show the currently played song.

Songs last about 3-4 minutes on average, but a user can skip songs or otherwise manually choose different songs more frequently than that.

Will my widget be penalized if the reloadTimelines call is made every 3-4 minutes?

If so, what is the suggested algorithm for keeping the widget up-to-date in this situation?

It's not a good user experience to simply implement 15 minute throttling, as users will mistrust the widget if it is typically several songs out of date.

Is it recommended that the app try only refresh the widget when the app loses focus?

What about the case of a music app that is playing a playlist of short songs while in the background? In that case the app is not "in focus" in the first place.

For reference, here's an example Apple Developer Forum post where the comment is made that changing a timeline once a minute is too fast, and that a target of once every 15 minutes is a reasonable target.

https://developer.apple.com/forums/thread/653265


Answered by in 620894022
Hi jackpal, apps that have an active media playback session are allowed to reload their timeline without penalty
Oh, one correction -- I think it's typical for a music app's "Recently Played" widget to show the N most recently played "containers", that is the most recently played playlists or albums, rather than the N most recently played songs. That makes the average case better. But the worst-case behavior is still there. What should a music app do if the user auditions a large number of playlists in a short period of time?
Hi jackpal, apps that have an active media playback session are allowed to reload their timeline without penalty
Good to know, thanks!
WidgetCenter.reloadTimelines allowed frequency?
 
 
Q