Starting Live Activity with push notification

Hello all, I am trying to start Live Activity from remote push notification with the new ActivityKit api.

The documentation for starting live activity from a push notification says:

  • When the system receives the ActivityKit push notification on a device, it starts a new Live Activity, wakes up your app, and grants it background run time to allow you to download assets that the Live Activity needs.
  • While the system starts the new Live Activity and wakes up your app, you receive the push token you use for updates. To update and end the Live Activity, use this update push token as if you obtained it by starting a Live Activity from within your app.

Is there any information on how to get access to the background runtime and the push token, when the app is in background when the Live Activity is started? I can get the pushToStartTokenUpdates if the app is already running and push notification arrives (and starts the Live Activity), but not in the background, which makes getting updates not possible unless user launches the app.

Thanks!

After some reading and testing, I came to conclusion that "Wakes up your app" is only true "if the app was already running in background", so it is only possible to receive an update if the app was not terminated.

try from this link https://apnspush.com/how-to-start-and-update-live-activities-with-push-notifications

I have the same problem. Well, at least somewhat. When my app is closed (not in background, completely closed), it is only awakened for roughly half of the started live activities.

I can't find any pattern in circumstances for when it fails:

  • It is not consistent wrt. devices
  • It is not consistent wrt. time-of-day
  • It is not consistent wrt. users
  • It is not consistent wrt. device connectivity
  • ....?

I am pretty confident that the app is simply not granted any execution time.

When it DEOS work, I see that application(_, didFinishLaunchingWithOptions) happens, and 3-4 seconds after that, the activity-specific push-token comes in.

hello,bro, i have the same problem. i can update and end the LiveActivity with remote notification. but start a LiveActivity is not work.i do not know how should i can do. if you handle it ,hope you can share with me. thanks in advance!

Starting Live Activity with push notification
 
 
Q