PushFyreAccelerate. Ignite. Broadcast.

Send a live notification that updates in place

8 min readPushFyre

A live notification, called a Live Activity in PushFyre, is one notification that updates in place instead of sending a new alert each time. Your backend starts it with POST /api/v1/live-activities, changes it with PATCH, and ends it with POST /end. It shows on the iOS lock screen, as an ongoing notification on Android, and in the browser.

What is a live notification?

A normal push notification says one thing and stays as it was sent. A delivery that moves from packed, to out for delivery, to arriving would need three of them, and each one is a new alert.

A live notification is one card that changes. PushFyre calls it a Live Activity. Your server starts it, and each update replaces the last one. It is not a new alert every time. The card can show a delivery, a score, a price, a countdown, a step count, or a pass.

Three separate push notifications for order packed, out for delivery, and arriving in 5 minutes, beside one live activity card for order 1042 that shows out for delivery at 60 percent.
Three pushes make three alerts. One Live Activity changes the card that is already there.

Where does it show up?

The same Live Activity calls are used on every platform. What the person sees depends on the phone or the browser.

iOS shows at most 5 Live Activities from one app at a time. Apple and Google can delay updates, and people who turned notifications off receive nothing.

  • iPhone on iOS 16.2 or later: a card on the lock screen. iPhone 14 Pro and later also show it in the Dynamic Island.
  • iOS 17.2 or later: PushFyre can start the activity while the app is closed.
  • Android 7 or later: an ongoing notification that updates in place. There is no Dynamic Island and no status-bar live-update chip.
  • Web on Chrome, Edge, and Firefox: the notification is replaced in place. Safari support is limited, and there is no lock-screen widget.
Three cards: an iPhone lock screen on iOS 16.2 or later, an Android ongoing notification on Android 7 or later, and a web notification replaced in place on Chrome, Edge, and Firefox.
The same activity appears as a lock-screen card, an ongoing notification, or a replaced web notification.

How do you start, update, and end one from your backend?

Call the Live Activity endpoints from the service that already knows the state. They use the same three headers as the send API: x-app-id, x-tenant-id, and x-api-key. Keep the key on the server. A start is POST /api/v1/live-activities, and the response is 202. Add an Idempotency-Key header when a retry must not start a second activity.

The activityKey is your own id, such as order-1042, and it goes in the update and end paths. PATCH /api/v1/live-activities/{key} sends only the fields in state that changed, and can also set endsAt or staleAt. POST /api/v1/live-activities/{key}/end removes the card, with an optional final state. Eight hours after the start, PushFyre marks the activity expired and sends that same end, so the card is removed on Android, the web, and iOS.

Four steps: start with POST /live-activities at 20 percent, update with PATCH at 60 percent, update again at 90 percent, and end with POST /end. An activity also ends by itself 8 hours after it starts.
Start once, update as the state changes, and end when it is done.
Order 1042, from your server
# Start
curl -X POST https://push.example.com/api/v1/live-activities \
  -H "x-app-id: app_49e692ad" \
  -H "x-tenant-id: <your-tenant-id>" \
  -H "x-api-key: $PUSHFYRE_SERVER_KEY" \
  -H "Idempotency-Key: order-1042-start" \
  -H "Content-Type: application/json" \
  -d '{
    "activityKey": "order-1042",
    "layout": "delivery",
    "audience": "user",
    "externalUserId": "user-1",
    "state": { "title": "Order 1042", "status": "Packed", "progress": 20 }
  }'

# Update
curl -X PATCH https://push.example.com/api/v1/live-activities/order-1042 \
  -H "x-app-id: app_49e692ad" \
  -H "x-tenant-id: <your-tenant-id>" \
  -H "x-api-key: $PUSHFYRE_SERVER_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "state": { "status": "Out for delivery", "progress": 60 } }'

# End
curl -X POST https://push.example.com/api/v1/live-activities/order-1042/end \
  -H "x-app-id: app_49e692ad" \
  -H "x-tenant-id: <your-tenant-id>" \
  -H "x-api-key: $PUSHFYRE_SERVER_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "state": { "status": "Delivered", "progress": 100 } }'

Which layout fits?

Each activity uses one layout, and state carries the fields that layout needs.

On an update to a dynamic activity, leaving dynamic out keeps the blocks already stored. Sending an empty blocks list removes them.

  • delivery needs a title, a status, and progress from 0 to 100.
  • steps needs a title, the step name, the current step, and the total.
  • score needs two names and two scores.
  • price needs a name, a value, a change, and a change percent.
  • countdown needs a title and an end time. The clock runs on the phone.
  • pass needs a title, a code, and a short detail.
  • dynamic draws only the blocks in state.dynamic: text, image, and button blocks, which can sit inside rows and columns. It needs at least one block.
Seven layouts: delivery with a progress bar, steps with four dots, score with two teams, price with a change, countdown with a clock, pass with a code, and dynamic with your own blocks.
Seven layouts. Each one needs only the fields listed under it.

Who receives it?

Set audience on the start call. Use device with a deviceId for one device, user with an externalUserId for one person, or broadcast for every subscriber.

On iOS 18 or later, a large audience can share one Apple broadcast when a channel token is registered. Otherwise each phone is updated, up to the broadcast cap. A broadcast activity also reaches Push Link subscribers on the web.

What does the app have to do?

The device registers through the Android SDK, the iOS SDK, or the web script. Your backend does not handle Live Activity tokens. Until an iOS token arrives, iOS is left out of that activity.

  • Android: no extra call. Every Android device registered with PushFyre receives a broadcast, and a device or user activity reaches the phones it names. Each update replaces one ongoing notification.
  • iOS: upload your APNs key in the portal. Live Activity updates use the same key. Add the PushFyreLiveActivity library and a Widget Extension that includes PushFyreActivityWidget(), set NSSupportsLiveActivities to YES, and call PushFyreLiveActivity.enable() at launch.
  • Web: after init, call PushFyre.liveActivities.subscribe("order-1042"). The service worker replaces one notification and ignores an older update.

When is a live notification the right tool?

Use one when a single thing is changing and the person should see the latest state without another alert: a delivery, a score, a price, a countdown. A push from your own backend is the better call for one message, such as a receipt or an offer. A journey is for separate messages with waits and branches.

The most common case is an order update, where the card moves from packed to delivered while the person does something else. Every plan can run an unlimited number of Live Activities. Plan details are on the pricing page.

Do it in four steps

  1. Step 1

    Connect the platforms

    Install the SDK on each platform so devices register. For iOS, upload the APNs key and add the Live Activity widget.

  2. Step 2

    Start the activity

    From your server, post an activityKey, a layout, an audience, and the starting state.

  3. Step 3

    Update it as things change

    Patch only the fields that changed. Each update replaces the last card.

  4. Step 4

    End it

    Post to the end path with an optional final state, or let it end by itself 8 hours after it starts.

Questions

How is this different from a normal push notification?

A push is a new alert each time. A Live Activity is one card that your server updates in place, so a delivery can move from packed to delivered without a new alert for each step.

Does it work on Android and the web?

Yes. Android 7 or later shows an ongoing notification that updates in place. Chrome, Edge, and Firefox replace the notification in place, and Safari support is limited. Android has no Dynamic Island and no status-bar live-update chip. The web has no lock-screen widget.

How long does an activity last?

Up to 8 hours. After that PushFyre marks it expired and sends the same end, so the card is removed on iOS, Android, and the web. You can end it earlier with the end call.

How many Live Activities can I run?

Every plan can run an unlimited number. iOS still shows at most 5 from one app at a time.

Will everyone see every update?

Apple and Google can delay updates. People who turned notifications off receive nothing.

Keep reading

Put the next send on your server

Create the app, generate a server key, and call the same endpoint your backend already knows how to reach.