Updating Widget from App Intent called by Live Activity is inconsistent

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

Our engineering teams need to investigate this issue, as resolution may involve changes to Apple's software. I'd greatly appreciate it if you could open a bug report, include a sysdiagnose while the issue is happening, and post the FB number here once you do. Bug Reporting: How and Why? has tips on creating your bug report.

Hey, I already have a case-id, 9879068 is that good or do you need me to file something separate?

(I have included my test project in that ticket)

Hi there, any chance of an update here? As I mentioned I tried to use up one of my 2 code-level support tickets, no response there either.

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

Hey huge thanks for responding and sorry for being late I missed it!

OK. A couple of comments:

1 - Your last comment, it's not accurate. In our app, we have Lock Screen widgets. They are visible at the same time and it looks very strange that they do not get updated when the live activity does. If you do it from the Dynamic Island and have a widget below on the Home Screen, you can see it there too.

This is a big reason to why we think it's so bad.

2 - It's not really an issue if the widget being updated 5-10 seconds, or perhaps even 30 at times. However if you run my example app you quickly see that often the widget isn't updated at all, even hours later.

3 - This happens a lot. We have been running this for weeks, and we quickly get in to situations where the widgets aren't updating for hours or for the rest of the day even though the live activity has been updated over 50 times. Again, always works in Xcode.

To me, it's clear that this is not a battery or prioritization issue because it happens consistently after a while. This is why I mentioned the "budget" thing possibly being an issue despite the documentation saying otherwise.

4 - I've seen this behavior in other apps that have both Lock Screen widgets and live activities.


To summarize: To me, this is an obvious flaw. It provides a bad user experience. If you tested my simple project, surely you saw this?

So, my final 2 questions are these:

1 - I am not doing anything wrong as in the code has errors that can be fixed? The inconsistent or skipped updates is working as intended?

2 - Should I create a bug report?

Would be great with a confirmation/response so that we can think about whether to actually go live with this.

Again, thanks for your time, appreciated.

Updating Widget from App Intent called by Live Activity is inconsistent
 
 
Q