Skip to content
Menu

Live Activities

Live Activities setup

Markdown version

Add the Live Activity widget to your iPhone app, turn on Apple's Broadcast Capability, and learn what a Live Activity campaign can and cannot do.

A Live Activity is a card on the iPhone lock screen and in the Dynamic Island that stays up until an end time, with a progress bar or a countdown. Herald starts one from a campaign and ends it at the end time you set.

On iPhone, Live Activities need iOS 18 or later; older versions do not receive them. The same campaign reaches Android phones as a Live Update; see Live Activities on Android. This page sets up the iPhone side.

1. Add a Widget Extension

In Xcode choose File › New › Target › Widget Extension. You can leave "Include Live Activity" off; Herald supplies the view.

2. Add the HeraldLiveActivity product

Add the HeraldLiveActivity library product from the Herald Swift package to the widget extension. It has no dependency on HeraldSDK, so it is safe to link from an extension. The app target links HeraldSDK, which depends on it, so the app sees the same HeraldActivityAttributes type.

3. Add the widget to your WidgetBundle

swift
import WidgetKit
import HeraldLiveActivity

@main
struct MyWidgets: WidgetBundle {
    var body: some Widget {
        HeraldLiveActivityWidget()
    }
}

The widget shows the title, the body and either a progress bar or a countdown, on the lock screen and in the Dynamic Island. A tap opens the campaign's deep link.

4. Set NSSupportsLiveActivities

In the app's Info.plist (not the extension's), set NSSupportsLiveActivities to YES.

5. Turn on Broadcast Capability

Herald starts and updates activities with Apple's broadcast push. Enable it for your App ID at developer.apple.com › Certificates, IDs & Profiles › Identifiers › your App ID › Push Notifications › Broadcast Capability. It cannot be turned on from Xcode.

6. Nothing else to call

After configure, the SDK sends the Live Activity push-to-start token to Herald on iOS 18 and later. Like the push token, it is not sent while the SDK is disabled. See Consent and opt-out.

What a campaign can do

  • A start alert is required: the notification that appears when the activity starts.
  • Title up to 40 characters, body up to 80.
  • A progress bar or a countdown.
  • It ends at most 8 hours after it starts. Herald ends it at that time.
  • The campaign page has Update Live Activity (title, body, progress, end time) and End now.
  • Delivery is not in local time, and it respects quiet hours.
  • One Live Activity start per person per 72 hours, counted apart from push.
  • It needs Herald's own APNs delivery (iPhone) or FCM delivery (Android), not Braze.
  • Results show "—" for delivered and opened, because Apple does not report them for broadcast.

To check your setup, send a test from the campaign. See Testing push.

See Herald decide live →