---
title: "Keep Live Activity push tokens apart from · Agent Wranglers"
url: https://agentwranglers.se/playbook/notifications/native-push/live-activity-tokens
id: NTF-42
level: Recommended
updated: 2026-10-27
build: a2a6bdfed830
tokens: 1091
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Keep Live Activity push tokens apart from device tokens

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Native push](https://agentwranglers.se/playbook/notifications/native-push.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-27.

- ID: NTF-42
- Level: Recommended
- Chapter: [Native push](https://agentwranglers.se/playbook/notifications/native-push.md)
- Rule: Store each Live Activity's push token and push-to-start token apart from the device token, and replace them when the app reports new ones. Send updates with the `liveactivity` push type.
- Check: A server test sends an update for an activity. The APNs request carries `apns-push-type: liveactivity`, the `.push-type.liveactivity` topic and the activity's own token, never the device token. A test that reports a new activity token replaces the stored one.
- How: An iOS Live Activity, such as a delivery tracker on the Lock Screen, gets its own push token. Apple says to read it from the `pushTokenUpdates` sequence, because it can change, and to send each new value to your server. A push-to-start token, from `pushToStartTokenUpdates`, lets the server start an activity while the app is closed. Send to APNs with the `apns-push-type` header set to `liveactivity` and the topic `<bundle ID>.push-type.liveactivity`. Set `event` to `start`, `update` or `end`, and `timestamp` to the current time, so the phone shows the newest state. Delete the token when the activity ends, as [Delete dead subscriptions and tokens at once](https://agentwranglers.se/playbook/notifications/push-notifications/prune-push-subscriptions.md) says. The device token keeps carrying ordinary pushes, as [Use the current APNs and FCM interfaces](https://agentwranglers.se/playbook/notifications/native-push/apns-fcm-current-apis.md) says.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### Plain text example

```swift
Task {
    for await token in activity.pushTokenUpdates {
        let hex = token.map { String(format: "%02x", $0) }.joined()
        try await api.saveActivityToken(activityId: activity.id, token: hex)
    }
}
```

### JavaScript example

```js
export async function updateLiveActivity(activity, contentState) {
  await apns.send({
    token: activity.pushToken,
    headers: { 'apns-push-type': 'liveactivity', 'apns-topic': `${BUNDLE_ID}.push-type.liveactivity`, 'apns-priority': '10' },
    payload: { aps: { timestamp: Math.floor(Date.now() / 1000), event: 'update', 'content-state': contentState } },
  });
}
```

### Python example

```python
import time

def update_live_activity(activity, content_state: dict) -> None:
    apns.send(
        token=activity.push_token,
        headers={"apns-push-type": "liveactivity", "apns-topic": f"{BUNDLE_ID}.push-type.liveactivity", "apns-priority": "10"},
        payload={"aps": {"timestamp": int(time.time()), "event": "update", "content-state": content_state}},
    )
```

## Sources

- [Apple, Starting and updating Live Activities with ActivityKit push notifications](https://developer.apple.com/documentation/activitykit/starting-and-updating-live-activities-with-activitykit-push-notifications)

## Related rules

- NTF-13 [Delete dead subscriptions and tokens at once](https://agentwranglers.se/playbook/notifications/push-notifications/prune-push-subscriptions.md) in Notifications
- NTF-11 [Use the current APNs and FCM interfaces](https://agentwranglers.se/playbook/notifications/native-push/apns-fcm-current-apis.md) in Notifications

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/notifications/native-push/live-activity-tokens">Agent Wranglers notifications playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Match each type to the platform's alert level](https://agentwranglers.se/playbook/notifications/native-push/push-interruption-levels.md)
- [Native push](https://agentwranglers.se/playbook/notifications/native-push.md)
