WidgetCenter.shared.reloadAllTimelines() only works when app is in the foreground

Hi y'all, I'm trying to create an Intent Extension that updates a widget, but I can't get the widget to update unless the app is in the foreground. Right now I'm using .continueInApp, but that's not such a great UX...

Has anyone experienced this? I've submitted it as FB7845957
Post not yet marked as solved Up vote post of bouk Down vote post of bouk
2k views

Replies

Hi there, I can confirm this.
In my case, calling WidgetCenter.shared.reloadAllTimelines() from the intent extension updates the widget fine when running the main app target from Xcode. Once Xcode is stopped, the intent can update the widget once or twice, and then stops working.
I have the same problem. I have tried using a silent push notification, that way the app does get woken up in the background and I tried calling the WidgetCenter.shared.reloadTimelines method right from there. The result was the same, the widget did not get updated if the application is not in the foreground.

It's sad 3 years later I face the same issue in iOS 17 - WidgetCenter.shared.reloadAllTimelines() works only on foreground (or when running the app from Xcode). Does anyone found a workaround?