Live Activity Start and Update Token Invalidation

Hi everyone,

I have a question about Live Activity start tokens and update tokens. After reading the documentation, it is still not very clear to me how often these tokens are invalidated, and whether their expiration is time-based or event-based.

My current understanding is that the update token is generated when the Live Activity starts, and that it becomes invalid when the activity ends or is dismissed by the user. What I am not clear on is whether the update token can also become invalid at any point while the Live Activity is still active.

I have a similar question about the start token. I have noticed that it is generated on the initial app launch, but I have also seen it get regenerated at what seems like random times. I would like to better understand what events or conditions cause a new start token to be issued.

Is there any official guidance on the lifecycle of these tokens, specifically:

  • whether they expire based on time,
  • whether they are only invalidated by specific events,
  • and what conditions trigger regeneration of the start token or update token?

Any clarification would be appreciated. Thanks.

Thank you for post.

Your understanding that the update token is generated when the Live Activity starts and becomes invalid upon its conclusion is largely accurate. However, it is important to note that the update token can indeed change and become invalid while the Live Activity remains active. The absolute expiration of the token is event-based, occurring when the activity is dismissed or reaches its predetermined lifespan.

Token regeneration during the activity is triggered by APNs routing events. Therefore, it is crucial for you to monitor the pushTokenUpdates asynchronous sequence on the Activity object. Simply obtaining the token once when the activity begins is insufficient. You must continuously listen to this sequence throughout the duration of the Live Activity. If APNs invalidates the current token and issues a new one, this sequence will yield the new token, and you must promptly transmit it to your server to replace the old one.

There is no strict time limit for APNs token expiration, as the system is designed to be dynamic. The tokens expire when the activity concludes. Your application must continuously listen to pushTokenUpdates for active activities and pushToStartTokenUpdates for initiating new ones.

Albert
  Worldwide Developer Relations.

Live Activity Start and Update Token Invalidation
 
 
Q