Push-to-Start Live Activity Background Task Issue After App Termination

Desired Behavior

I want the app to be able to handle multiple Push-to-Start notifications even when it is completely terminated. Each Live Activity should:

  1. Be successfully displayed upon receiving a Push-to-Start notification.
  2. Trigger background tasks to send its update token to the server, regardless of the time interval between notifications.

Problem

I am facing an issue with iOS Live Activities when using Push-to-Start notifications to trigger Live Activities in an app that has been completely terminated. Here’s the detailed scenario:

  1. When the app is completely terminated and I send the first Push-to-Start notification:
    • The Live Activity is successfully displayed.
    • didFinishLaunchingWithOptions` is triggered, and background tasks execute correctly, including sending the update token to the server.
  2. When I send consecutive Push-to-Start notifications in quick succession (e.g., within a few seconds or minutes):
    • Both notifications successfully display their respective Live Activities.
    • Background tasks are executed correctly for both notifications.
  3. However, when there is a longer interval (e.g., 10 minutes) between two Push-to-Start notifications:
    • The first notification works perfectly—it displays the Live Activity, triggers didFinishLaunchingWithOptions, and executes background tasks.
    • The second notification successfully displays the Live Activity but fails to execute any background tasks, such as sending the update token to the server.

My HypothesisI

suspect that iOS might impose a restriction where background runtime for Push-to-Start notifications can only be granted once within a certain time frame after the app has been terminated.

Any insights into why this issue might be occurring or how to ensure consistent background task execution for multiple Push-to-Start notifications would be greatly appreciated!

Hi,

When testing you will want to enable frequent updates as a first step.

Sending too many pushes in a short period of time will almost certainly lead to throttling.

To debug use Console.app and look for logs relating to your processes (target names), apd (the apns daemon) and the topic you are using for push.

Are you creating a background task when the pustToStartToken and / or pushTokenUpdates callback is sent in your Live Activity process?

You should be able to just make the API call from that block as it will wake your app in the background to allow for this.

Please note, none of this happens in your application delegate, it all happens in your Live Activity.

Push-to-Start Live Activity Background Task Issue After App Termination
 
 
Q