Live Activities
Update, end, start and broadcast iOS Live Activities from your server, by a key of your own.
A Live Activity keeps something that’s happening, such as an order or a game, on the Lock Screen and in the Dynamic Island. Your app draws it with a widget; pushes from your server keep it current. With Pushwren you address each activity by a key of your own, such as order-A1001, and one call updates or ends it on every device that has it. Your server never stores Apple’s tokens.
Apple has three ways to drive an activity with pushes, and Pushwren supports all three:
| What | iOS | In the app | From your server |
|---|---|---|---|
| Update and end an activity the app started | iOS 16.1 and later | track(_:key:) |
PATCH /v1/live-activities/{key}, POST …/{key}/end |
| Start an activity from your server | iOS 17.2 and later | enableRemoteStart(for:) |
POST /v1/live-activities |
| Broadcast one update to every device following a key | iOS 18 and later | channel(for:) |
POST /v1/live-activities/broadcasts, then update by key |
Live Activities are iOS and iPadOS only, and need version 0.4.1 or later of the Swift package. Like every push, a Live Activity update is accepted when Apple takes it; Apple never confirms that a device displayed it.
The activity type
Remote start needs your activity type to conform to PushwrenActivityAttributes, which adds one stored property, pushwrenKey. A push that starts an activity gives the app only its attributes and content, so Pushwren writes the start’s key into the attributes, and the app tracks the new activity under it. The same type works with track, so start with it even if you don’t need remote start yet:
import ActivityKit
import Pushwren
struct OrderAttributes: PushwrenActivityAttributes {
struct ContentState: Codable, Hashable {
var status: String
var etaMinutes: Int
}
var pushwrenKey: String // stored, so the key a remote start writes decodes into it
var orderNumber: String
}
- Keep
pushwrenKeya stored property with that name, with noCodingKeysrenaming it. - The widget extension needs the type too. If you’d rather not link Pushwren there, declare the type as plain
ActivityAttributesin a file both targets share, and addextension OrderAttributes: PushwrenActivityAttributes {}in the app. - Pushwren names the type by its Swift name,
String(describing: OrderAttributes.self): here"OrderAttributes". Apple matches that name on a remote start, so your server sends exactly it asattributesType. - Your server sends the content state as JSON with the
ContentState’s property names:{ "status": "Preparing", "etaMinutes": 12 }.
The widget Apple requires
- Add a widget extension (File › New › Target › Widget Extension, with Include Live Activity ticked) and draw the activity there with an
ActivityConfiguration(for: OrderAttributes.self). - In the app target’s Info tab, add
NSSupportsLiveActivities(Supports Live Activities), a Boolean set to YES. - The app already has the Push Notifications capability from the quickstart.
The SDK repository has a sample app with one activity type, its widget, and the Xcode steps, to try each mechanism on a phone.
Update and end an activity the app started
Needs iOS 16.1 or later. After the app starts an activity with a push token, hand it to Pushwren with its key:
let attributes = OrderAttributes(pushwrenKey: "order-A1001", orderNumber: "A1001")
let content = ActivityContent(state: OrderAttributes.ContentState(status: "Received", etaMinutes: 20), staleDate: nil)
let activity = try Activity.request(attributes: attributes, content: content, pushType: .token)
Pushwren.liveActivities.track(activity, key: "order-A1001")
(ActivityContent needs iOS 16.2; on iOS 16.1, Activity.request(attributes:contentState:pushType:) takes the state directly.) Pushwren reports the activity’s update token, again whenever Apple rotates it, and the activity’s end. It tracks an activity only while the app runs, so track the ones still running at each launch:
for activity in Activity<OrderAttributes>.activities {
Pushwren.liveActivities.track(activity, key: activity.attributes.pushwrenKey)
}
On iOS 17.2 and later, with remote start enabled for the type (next section), Pushwren already tracks every activity of that type, so this loop isn’t needed there.
From your server, update the activity by its key:
curl -X PATCH https://api.pushwren.com/v1/live-activities/order-A1001 \
-H "Authorization: Bearer $PUSHWREN_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{ "contentState": { "status": "Preparing", "etaMinutes": 12 } }'
and end it, with an optional final content state and the time to remove it from the Lock Screen:
curl https://api.pushwren.com/v1/live-activities/order-A1001/end \
-H "Authorization: Bearer $PUSHWREN_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{ "contentState": { "status": "Picked up", "etaMinutes": 0 }, "dismissalDate": "2026-12-01T18:30:00Z" }'
Each answers 202 with { "key": "order-A1001", "status": "queued" }. An end without a content state sends the newest content at the time you call it: that of your last update, even one still queued. An update can also carry an alert, a staleDate and a relevanceScore; Live Activities has every field.
Once an end is accepted the key takes nothing more until it is sent, usually within seconds: a further update or end answers conflict, and so does a start, saying to start again in a moment.
High and low priority
Apple limits how often high-priority updates reach a device, and iOS throttles an activity that updates too often. Updates go at high priority unless you say otherwise. Send "priority": "low" for an update that can wait: it doesn’t count against that budget, and iOS applies it when it chooses. If your activity really needs frequent updates, a sports score say, add NSSupportsLiveActivitiesFrequentUpdates (a Boolean set to YES) to the app’s Info.plist; the user can still turn frequent updates off in Settings.
Start an activity from your server
Needs iOS 17.2 or later. At each launch, after configure, let your server start activities of the type:
if #available(iOS 17.2, *) {
Pushwren.liveActivities.enableRemoteStart(for: OrderAttributes.self)
}
Pushwren reports the type’s push-to-start token and each rotation of it, and tracks every activity of the type, started by a push or by the app, under its pushwrenKey. Then start one:
curl https://api.pushwren.com/v1/live-activities \
-H "Authorization: Bearer $PUSHWREN_SECRET_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-A1002-start" \
-d '{
"key": "order-A1002",
"attributesType": "OrderAttributes",
"attributes": { "orderNumber": "A1002" },
"contentState": { "status": "Received", "etaMinutes": 25 },
"target": { "userIds": ["u_123"] },
"alert": { "title": "Order A1002", "body": "We have your order." }
}'
alertis required: Apple requires one on a remote start, so the activity never appears unannounced.targetworks as for a notification. Only devices that have reported a push-to-start token for the type are reached; the others are skipped. A start that reaches no device marks the activityfailedwithNoPushToStartToken(or Apple’s reason, when Apple refused each device).- Leave
pushwrenKeyout ofattributes: Pushwren adds it. - On iOS 18 and later, a remote start asks iOS for the activity’s update token, and the SDK reports it, so later updates reach the device by key. Whether iOS 17.2 to 17.x issues an update token after a remote start isn’t confirmed yet; until it is, don’t count on updating a remotely started activity on iOS 17.
The person must allow Live Activities
The first time a remote start reaches a device, iOS shows the new activity with Apple’s prompt, “Allow Live Activities from your app?”. iOS hands the app the activity’s update token only after the person taps Allow, and only then can the SDK report it. Until they do, the activity stays on the Lock Screen as it started: updates and the end can’t reach it, and GET /v1/live-activities/{key} keeps that device’s at at the start’s time. If they don’t allow it, they can turn Live Activities on later in Settings under your app.
- Ask at a good moment. A start the person expects (they just placed the order) is likelier to be allowed than one out of nowhere.
- An activity the app starts itself gets its update token without the prompt; the prompt still appears with that activity’s first update.
- Seen on iOS 27.3 (November 24, 2026); Apple’s documentation doesn’t mention it.
A new account’s first broadcast to more than 10,000 devices is reviewed before it goes out, and a Live Activity start can’t wait for review. So in an account’s first 7 days, a start to all or to tags reaching more than 10,000 devices answers forbidden. Send a regular notification to that audience first; once it is released, start the activity again.
Broadcast to every follower
Needs iOS 18 or later, and Apple’s Broadcast capability on your App ID. Xcode can’t turn it on: on developer.apple.com, open Certificates, Identifiers & Profiles › Identifiers, select the App ID, and under Push Notifications turn on Broadcast Capability. Without it, creating a broadcast key answers broadcast_not_enabled.
Your server creates the broadcast key once. Pushwren makes an Apple channel for it in each environment where your app has a valid APNs key:
curl https://api.pushwren.com/v1/live-activities/broadcasts \
-H "Authorization: Bearer $PUSHWREN_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{ "key": "game-4521" }'
The app looks up the channel for its own environment and starts an activity that follows it:
let channel = try await Pushwren.liveActivities.channel(for: "game-4521")
let attributes = OrderAttributes(pushwrenKey: "game-4521", orderNumber: "Everyone")
let content = ActivityContent(state: OrderAttributes.ContentState(status: "Waiting", etaMinutes: 0), staleDate: nil)
_ = try Activity.request(attributes: attributes, content: content, pushType: .channel(channel))
channel(for:) only looks the channel up; it never makes one, and throws LiveActivityError.noChannel when the key has none for the device’s environment. Your server can also start the activity remotely with POST /v1/live-activities and the broadcast key: on iOS 18 it starts already following the channel.
Update and end a broadcast key with the same calls as any other key. Each is one request to Apple per channel, however many devices follow it, so there are no per-device results: Apple doesn’t say which devices follow a channel. A device that’s offline gets the latest update when it’s back, for up to about 8 hours.
A broadcast key stays until you delete it, even once ended, so you can start a new activity under it later. Deleting it deletes its Apple channels:
curl -X DELETE https://api.pushwren.com/v1/live-activities/broadcasts/game-4521 \
-H "Authorization: Bearer $PUSHWREN_SECRET_KEY"
Apple allows 10,000 broadcast channels per app in each environment. Past that, creating a key answers conflict: delete the keys you no longer need.
Keys
A key is 1 to 64 letters, digits and _ . : -, the same rule as tags.
Every private activity key must be unguessable. Any install of your app can follow an activity the app started under a key it knows, and receive its updates; it can also take a key first, before your server starts anything under it. For anything private, such as an order or a ride, include a random or secret part in the key: order-A1002-7f3c9a, not order-A1002. Keep the key on your server and in the user’s own app.
Reusing a key:
- A start on an active key your server started adds the devices it reaches to that activity. The type must match, or it answers
conflict. - A start on an active key the app started answers
conflict: start a new activity under a different key. - A start on an ended key, or one that is over, begins a new activity under it, replacing the old one and its devices.
- A key your server started is followed only by the devices its start reached: their apps report the update token and join it. Any other install that reports a token under it gets
conflict. - An activity the app started under a key joins that key’s app activity, from any install of the app.
- A broadcast key and a per-device key can’t share a name: the second answers
conflict. - An update or end on an ended key answers
conflict: start a new activity under it instead. An unknown key answersnot_found. - When the activity ends on its last device (the user dismissed it, or the app ended it), the activity ends.
- A per-device activity is over 12 hours after its last start, update or end, as Apple ends an activity after 8 hours and keeps it on the Lock Screen up to 4 more. It then shows as ended and is treated as one: a start begins a new activity under its key.
- An ended activity is kept for 7 days after it ends, then removed, and its key answers
not_found. A broadcast key never expires.
Results and limits
- Each device’s last result.
GET /v1/live-activities/{key}gives the activity’s state (active,endedorfailed) and each device’s last result:accepted, orfailedwith Apple’s or Pushwren’s reason. A device whose token Apple says is gone leaves the activity. The portal’s Live Activities page shows the same, and an AI tool can askwhy_not_updated. Reasons are explained in Delivery failures. - Failed. An activity is
failedwhen an update reached no device (every device’s token was gone, every broadcast channel refused it, Apple refused the Live Activity topic, or the app’s APNs key couldn’t send) or a start reached none. Itsreasonsays which. The next update or start Apple accepts makes it active again. TopicDisallowed. Apple refused the app’s Live Activity topic: check that the App ID has Push Notifications turned on, and that a key limited to specific apps covers this one. It fails only the Live Activity; your notifications keep going.- Try again. A call that met another one changing the same key at the same moment answers
try_again(503) with nothing changed: retry it. The SDK retries its own reports. - Size. Apple takes at most 4,096 bytes. Pushwren builds the payload when it accepts your call, and a larger one answers
payload_too_largewith nothing queued. - Rate. Every Live Activity call counts toward your app’s per-second rate limit.
- Usage. Starts, updates and calls are counted for each account and month, but not capped or billed for now. They never count toward your plan’s pushes or send requests.