iOS 16 Live Activities cann't be refreshed in the background ?

I tried this: https://developer.apple.com/documentation/activitykit/displaying-live-data-on-the-lock-screen-with-live-activities

I am building a workout app, the app can run in background , and I want to update the Live Activity realtime(once a second ) , so users can see the workout progress in realtime.

But as I test, when app in foreground the activity widget refreshed perfectly. But when the app goes to the background, it is not refreshed.

Post not yet marked as solved Up vote post of haozes Down vote post of haozes
3.5k views
  • WidgetKit gets some extra reloads for apps that use background location, like navigation. Unfortunately, I forget where that was documented or mentioned. Nothing is documented for ActivityKit yet in terms of reloads you can get or should expect to get. What is keeping your app from getting suspended while it is in the background?

  • Thanks for reply. With Apple Music integrated, app can running in the background when the music playing. do you mean this?

    WidgetCenter.shared.reloadTimelines

  • I am experiencing the same problem, and I've submitted FB11608466 to Apple.

Add a Comment

Replies

Any updates on this? I also have a workout app and I don't see my Live Activity being updated in the background. I try to update once a second, but also tried slowing it down to once every 10 seconds.

Also curious. I tried implementing BackgroundTasks and Timer but they don't provide the slick update like the Timer app provides. So I'm curious on how they were able to animate correctly or if its only for a private API

This is absurd. How is it "Live Activities" if you can't update it when your app is in background and it is not visible when your app is foreground. This is totally broken. We spent a ton of time on this only to find the feature doesn't really work! Only a joke app that sets a timer with no relation to a real activity would be possible with such an API.

  • You’re meant to mostly use Push notifications to update the state. It’s not meant to be like a widget directly and meant to give context of an event over time for all time monitoring when you’re in the foreground. That being said it does make me wonder on being able to update more

Add a Comment

Any progress on this issue?

Same Issue. How should i update my widget of an audio app playing content from the background? if the player halts or sleep timer stops playback, the widget never get reloaded about current position and playback status. i want to show current chapter shownotes but it is not possible at the moment... too bad