Live Activity Dissappearing

Hello,

I am experiencing an issue with the Live Activity feature in my application. Despite extensive debugging efforts, the problem persists, and I would greatly appreciate your assistance.

Here are the key details of the issue:

  1. We are not using APNS; everything related to Live Activities is handled locally within the app.
  2. The Live Activity displays task details, including: Task title, icon and A label functioning as a timer that shows the remaining time in seconds for the task.
  3. The Live Activity appears as expected when the app is opened. However, when the app is sent to the background, the Live Activity does not appear consistently. It disappears unexpectedly in some random instances.

I have tried various debugging methods, including:

  1. Ensuring the activity is correctly created and updated as per the Apple Documentation.
  2. Verifying the ActivityAttributes and ActivityContentState configurations.
  3. Testing with different app lifecycle events to determine when the issue occurs.

Despite these efforts, the issue remains unresolved, and the cause is unclear. The app behavior seems inconsistent, as the Live Activity sometimes remains visible and at other times disappears when the app is backgrounded.

I would greatly appreciate your help in understanding and addressing this issue. Specifically:

  1. Are there any system-level constraints or conditions that could cause a Live Activity to terminate when the app is backgrounded?
  2. Are there best practices or configurations to ensure the persistence of locally managed Live Activities?
  3. Can you suggest additional debugging techniques or tools that could help identify the root cause?

Thank you for your time and support. Please let me know if further information or logs are needed to assist in troubleshooting

STEPS TO REPRODUCE

  1. Download and Install the Owaves App from the App Store.
  2. Create a Live Activity:
  • Open the app and create an activity for the current time on Today.
  • Example: If the current time is 9:30 AM, create an activity with a time range such as 9:00 AM - 10:00 AM to ensure it is live.
  1. Enable Live Activity:
  • Tap on the newly created activity to open the Event Details page.
  • Scroll to the bottom of the page and locate the toggle switch labeled "Live Activity".
  • Switch the toggle to the ON position to enable the Live Activity.
  1. Background the App:
  • Send the app to the background.
  1. Check the Lock Screen:
  • Swipe down to enable iOS' Lock Screen and check for the Live Activity from the Owaves app.
  1. Repeat the Steps:
  • If the Live Activity appears on the Lock Screen initially, repeat steps 3-5 multiple times.
  • Eventually, you will encounter instances where the Live Activity does not appear on the Lock Screen, despite following the same process
Answered by sakz_gupz in 816660022

ignore. Updated post incoming

Accepted Answer

ignore. Updated post incoming

Hi,

The best first course of action here would be to use Console.app to monitor to the relevant processes related to your app and extensions.

A good way to start would be with filtering by the BundleID of the target and / or the target name itself (the process name).

Also be sure to check the system processes for additional information. This will vary based on what and where you are looking but some examples:
To debug APNS you'll want to monitor apd along with other relevant processes.
To debug WidgetKit, LiveActivities, Dynamic Island you'll want to monitor springboardd, liveactivitiesd along with other relevant processes.

Rico


WWDR | DTS | Software Engineer

Live Activity Dissappearing
 
 
Q