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.
activity_id in the URL. This is set when using the:event_updates parameter to a JSON object that matches the structure of the ActivityAttributes.ContentState struct defined in your Live Activity widget extension.
event parameter to enddismissal_date if you want the Live Activity to be dismissed in less than 4 hours.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.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.
The action to perform on the Live Activity. Options:update - Updates the content of an existing Live Activity without ending it. end — Ends the Live Activity and removes it from the user's view. See Apple's developer docs on Starting and updating Live Activities.
update, end The content used to update a running Live Activity. The object must conform to the ContentState interface defined within your app's Live Activity. See Live Activities developer setup.
An internal name you set to help organize and track messages. Not shown to recipients. Maximum 128 characters.
The push message body with language-specific values.
A Unix timestamp (in seconds) that indicates the date the Live Activity is considered outdated. Once this time is reached, the system updates the Live Activity to ActivityState.stale at which point you can update the Live Activity to indicate that its content is out of date.
A Unix timestamp (in seconds) indicating when the Live Activity should be removed from user's device. Use with the end event. If not set, the Live Activity will be dismissed automatically after 4 hours. To dismiss the Live Activity immediately, the user must have allowed the Live Activity first. Then you can set a date that’s in the past — for example, 1663177260. Alternatively, provide a date within a four-hour window to set a custom dismissal date before the default 4 hour period. See Apple's documentation for more.
Set the priority based on the urgency of the message. 10 - High priority. 5 - Normal priority. Apple allows a certain budget of High priority updates per hour. Exceeding the budget may throttle your messages. Apple recommends choosing a mix of priority 5 and 10 to prevent throttling. If your app needs more frequent updates, use NSSupportsLiveActivitiesFrequentUpdates entry as directed in Apple's Developer Docs.
5, 10 A value between 0 and 1. If you start more than one Live Activity for your app, the Live Activity with the highest relevance score appears in the Dynamic Island. If Live Activities have the same relevance score, the system displays the Live Activity that started first. Additionally, the Relevance Score determines the order of your Live Activities on the Lock Screen.
201
The ID of the Live Activity update request.