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
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