(Also have a case ID, 9879068)
We have an app that user use to check in/out from work for example. We have a button in-app do do this. Now I'm trying to add buttons to our widgets and our new live activity so that users don't have to open the app.
It's crucial that the live activity and widgets always show the exact same state.
Otherwise it'll look pretty bad if a user has both a live activity and a widget showin at the same time.
However, we have noticed that sometimes, pressing the button in the live activity, running the app intent, will not always make the widget update (we call reloadAllTimelines()). The other way around, i.e. press the button on widget to update live activity always works. (they both call the same app intent)
When running it in debug mode on a phone from Xcode, it always works, but when running it just on the phone it's unreliable.
My first thought was, of course, that's related to the widget "budget", but according to the docs HERE, it should not be applied when interacting with a widget, calling an app intent.
My question: HOW can I make my widget reliably refresh using an app intent invoked from a live activity??
I have a ready small project with simple buttons and trace labels that display this issue that I'm happy to supply to someone.
HI,
We looked into your sample. What you are seeing is a re-prioritization of device resources that is leading to unreliable reloading. The reloads will only happen at the same time for objects of the same kind (think Widget kind).
When you log the last updated time as Date(), as your sample does, its evident that the Live Activities and Widgets already do not reload at precisely the same time, this isn't possible as they are managed in different places and work with some of the same but also different processes.
The system itself, decides when and if things are reloaded. When there are constraints like low battery or a lot of other activity in the background, or an app with higher usage on a given device requesting additional resources at the same time, it can lead to experiences like what you are seeing on device.
Not to mention, in this explicit case, when your LA is visible, the Widgets are not and a request to reload your Widgets when not explicitly visible to the user is more likely to have a lower priority, where as an LA, especially when on dynamic island is essentially always visible. A Live Activity by nature would have a higher priority than a Widget that is designed to be glanceable from your Home Screen.
Hopefully this helps provide some background.
Rico
WWDR | DTS | Software Engineer