Update Live Activity
Update or terminate running iOS Live Activities using OneSignal’s Live Activities API. This endpoint enables real-time content updates and activity termination, ensuring dynamic, context-aware user experiences.
Overview
Update or terminate running iOS Live Activities using our REST API. This endpoint enables real-time content updates and activity termination, ensuring dynamic, context-aware user experiences.
Before using this API, ensure your app is properly configured by following the Live Activities developer setup.
How to Use this API
- Select the Live Activity to update by specifying its
activity_id
in the URL. This is set when using the:
-
Update the state of the Live Activity by setting the
event_updates
parameter to a JSON object that matches the structure of theActivityAttributes.ContentState
struct defined in your Live Activity widget extension. -
When ready to terminate the Live Activity:
- Set the
event
parameter toend
- Include a
dismissal_date
if you want the Live Activity to be dismissed in less than 4 hours. - Set the
dismissal_date
to a time in the past to dismiss the Live Activity immediately. User must have clicked “Allow” for the Live Activity to be removed programmatically.
Once a Live Activity activity_id
is ended, you cannot update it. This includes changing the dismissal_date
or event
parameter.
If the Live Activity is not being dismissed immediately, it is either because:
- The
activity_id
has already been ended. - The user has not clicked “Allow” for the Live Activity to be removed programmatically.
Path Parameters
Your OneSignal App ID in UUID v4 format. See Keys & IDs.
An identifier you set when starting the Live Activity to uniquely identify it and associated devices with the event. This value is crucial for maintaining a consistent reference to the Live Activity across different devices and sessions. Consider using a UUID, CUID, or NanoID for this parameter.
Body
Response
201
The response is of type object
.