You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `channelId` option subscribes the Live Activity to a broadcast channel for server-side updates. When provided, the activity receives updates via broadcast push notifications instead of individual device tokens—one server notification updates all activities on that channel. Requires `enablePushNotifications: true` and the Broadcast Capability enabled in your Apple Developer account.
100
+
101
+
```typescript
102
+
import { startLiveActivity } from'voltra/client'
103
+
104
+
awaitstartLiveActivity(variants, {
105
+
activityName: 'match-123',
106
+
channelId: 'CTrNsYq/Ee8AALLzHQaVlA==', // From APNs channel management
107
+
})
108
+
```
109
+
110
+
For full broadcast setup, see [Server-side updates - Broadcast push notifications](../development/server-side-updates.md#broadcast-push-notifications-ios-18).
111
+
97
112
These options can be used together with dismissal policy and other configuration options:
Live Activities can receive updates even when your app is in the background or terminated, but they cannot execute JavaScript code. For real-time updates from backgrounded apps, use server-side push notifications.
259
260
261
+
### Channel ID (broadcast push, iOS 18+)
262
+
263
+
Subscribes the Live Activity to a broadcast channel for server-side updates. When provided, the activity receives updates via broadcast push notifications instead of individual device tokens—one server notification updates all activities on that channel.
264
+
265
+
```typescript
266
+
// For shared content (e.g., live sports, flight status)
267
+
awaitstartLiveActivity(variants, {
268
+
activityName: 'match-123',
269
+
channelId: 'CTrNsYq/Ee8AALLzHQaVlA==', // From APNs channel management
270
+
})
271
+
```
272
+
273
+
Requires `enablePushNotifications: true` in the Voltra plugin and the Broadcast Capability enabled in your Apple Developer account. See [Server-side updates](./server-side-updates.md#broadcast-push-notifications-ios-18) for details.
Copy file name to clipboardExpand all lines: website/docs/ios/development/server-side-updates.md
+47Lines changed: 47 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -210,6 +210,53 @@ useEffect(() => {
210
210
211
211
Use only Voltra-provided tokens, which are specialized for Live Activity push notifications and different from regular device tokens. Update tokens are tied to specific Live Activities, while push-to-start tokens are for starting new activities. Update tokens are provided when Live Activities are started and may change during the activity's lifecycle. When sending notifications via APNS, use these push tokens as the target device token to route notifications to the correct Live Activity or device.
212
212
213
+
## Broadcast push notifications (iOS 18+)
214
+
215
+
Starting with iOS 18 and iPadOS 18, you can use **broadcast push notifications** to update many Live Activities with a single push notification. Instead of sending individual notifications to each device token, you send one broadcast to a shared channel—all Live Activities subscribed to that channel receive the update. This is ideal for scenarios like live sports scores or flight status where many users follow the same event.
216
+
217
+
### Prerequisites
218
+
219
+
1.**Enable Broadcast Capability:** In your [Apple Developer account](https://developer.apple.com/account), go to Certificates, Identifiers & Profiles > Identifiers, select your App ID, and enable **Broadcast Capability** under Push Notifications.
220
+
221
+
2.**Create a channel:** Your server creates a channel via APNs and receives a channel ID. You can maintain up to 10,000 channels per app. Use [Apple Push Notification Console](https://icloud.developer.apple.com/dashboard/notifications/) or the [channel management API](https://developer.apple.com/documentation/usernotifications/sending-channel-management-requests-to-apns) to create channels.
222
+
223
+
3.**Plugin configuration:** Keep `enablePushNotifications: true` in your Voltra plugin config—the `aps-environment` entitlement is still required for broadcast push.
224
+
225
+
### Starting a Live Activity with a channel
226
+
227
+
Pass the `channelId` option when starting a Live Activity to subscribe it to a broadcast channel:
channelId: 'CTrNsYq/Ee8AALLzHQaVlA==', // Channel ID from your server
236
+
})
237
+
```
238
+
239
+
When `channelId` is provided, the Live Activity subscribes to broadcast updates. On iOS versions before 18, `channelId` is ignored and the activity starts without push support.
240
+
241
+
### Sending broadcast updates
242
+
243
+
To update all Live Activities on a channel, send a POST request to APNs with:
244
+
245
+
-**Path:**`/4/broadcasts/apps/<your.bundle.id>` (bundle ID without the `.push-type.liveactivity` suffix)
246
+
-**Header:**`apns-channel-id: <Channel ID>`
247
+
-**Payload:** Same structure as individual updates—`event: "update"`, `content-state`, `timestamp`, etc.
248
+
249
+
For the full broadcast payload format and headers, see [Apple's broadcast push documentation](https://developer.apple.com/documentation/usernotifications/sending-broadcast-push-notification-requests-to-apns).
250
+
251
+
### Broadcast vs. individual tokens
252
+
253
+
| Aspect | Individual tokens | Broadcast |
254
+
|--------|-------------------|-----------|
255
+
| Server sends | One notification per device | One notification per channel |
256
+
|`activityTokenReceived` event | Fires for each activity | Does not fire |
257
+
| Best for | Per-user content (orders, rides) | Shared content (scores, flights) |
258
+
| iOS version | 16.2+ | 18+ |
259
+
213
260
## Handling background execution
214
261
215
262
When Live Activity tokens change or need to be refreshed, iOS may wake your app in the background to deliver new tokens. The app has a limited window of time (typically around 30 seconds) to handle the event and communicate with your server before iOS may suspend or terminate the background process.
0 commit comments