iOS Live Activities API
Apple documentation:
startLiveActivity
Anchor link toUse this method to create iOS Live Activities.
POST https://api.pushwoosh.com/json/1.3/startLiveActivity
Allows creating iOS Live Activities.
Request body
Anchor link to| Parameter | Type | Required/Optional | Description |
|---|---|---|---|
| application | String | Required | Pushwoosh application code |
| auth | String | Required | API access token from the Pushwoosh Control Panel. |
| notifications | Array | Required | JSON array of message parameters. See details in the Notifications table below. |
Notifications
Anchor link toParameters used in the notifications array:
| Parameter | Type | Required/Optional | Description |
|---|---|---|---|
| content | String | Required | Fallback content for devices running iOS versions below 16.1 that do not support Live Activity. On iOS 16.1+ (with Live Activity support), content is sourced from the live_activity field. |
| title | String | Optional | The title of the notification message. |
| live_activity | Object | Required | Live Activity data to create Live Activity in iOS. |
| content-state | Object | Required | Content for the Live Activity notification. |
| attributes-type | String | Required | The type of attributes used in the Live Activity. |
| attributes | Object | Required | Attributes for the Live Activity. |
| live_activity_id | String | Required | A unique ID for the Live Activity, created by the user. |
Response
Anchor link to200
{ "status_code": 200, "status_message": "OK", "response": { "Messages": [ "C3F8-C3863ED4-334AD4F1" ] }}Request example
Anchor link to{ "request": { "application": "XXXXX-XXXXX", // required. Pushwoosh application code "auth": "yxoPUlwqm…………pIyEX4H", // required. API access token from Pushwoosh Control Panel "notifications": [{ "live_activity": { // required. Live Activity data to create Live Activity in iOS "content-state": { "emoji": ":wink:" }, "attributes-type": "LiveActivityAttributes", "attributes": { "name": "Apple" } }, "live_activity_id": "unique UUID" // optional. Unique identifier of the Live Activity. }] }}Note:
Read this article to learn more about working with Live Activities using the Pushwoosh iOS SDK.
updateLiveActivity
Anchor link toUse this method to manage iOS Live Activities.
POST https://api.pushwoosh.com/json/1.3/updateLiveActivity
Allows to create and manage iOS Live Activities.
Request body
Anchor link to| Parameter | Type | Required/Optional | Description |
|---|---|---|---|
| auth | String | Required | API access token from the Pushwoosh Control Panel. |
| application | String | Required | Pushwoosh application code |
| notifications | Array | Required | JSON array of message parameters. See details in the Notifications table below. |
Notifications
Anchor link toParameters used in the notifications array:
| Parameter | Type | Required/Optional | Description |
|---|---|---|---|
| live_activity | Object | Required | Live Activity data to update Live Activity in iOS. |
| event | String | Required | Specifies the event type. Use "update" to update the Live Activity or "end" to close it. |
| content-state | Object | Required | Object with key-value pairs used to pass data to Live Activity for updating its content. |
| dismissal-date | Integer | Optional | The time (in seconds) when the Live Activity should end. |
| live_activity_id | String | Required | A unique identifier for the Live Activity being updated. |
| relevance-score | Integer | Optional | Tells the iOS system which Live Activity has higher priority than others. Accepts values from 1 to infinity (values up to 100 are recommended). |
| stale-date | Integer | Optional | The time (in seconds) that represents the date at which a Live Activity becomes stale, or out of date. |
{ "status_code": 200, "status_message": "OK", "response": { "Messages": [ "C3F8-C3863ED4-334AD4F1" ] }}Request example
Anchor link to{ "request": { "application": "XXXXX-XXXXX", // required. Pushwoosh application code "auth": "yxoPUlwqm…………pIyEX4H", // required. API access token from Pushwoosh Control Panel "notifications": [{ "live_activity": { // required. Live Activity data to update Live Activity in iOS "event": "update", // required. Use "update" to update Live Activity or // "end" to close Live Activity "content-state": { // required. Object with key-value pairs used to pass data "courierName": "NUMBER: 15", // to Live Activity for updating its content "deliveryStatus": "Done" }, "dismissal-date": 12345678, // optional. Time of ending Live Activity in seconds "relevance-score": 50, // optional. Priority for the Live Activity (1 to 100 recommended) "stale-date": 23456789 // optional. Time (in seconds) when Live Activity becomes stale }, "live_activity_id": "unique UUID" // optional. Unique identifier of the Live Activity. }] }}Read this article to learn more about working with Live Activities using the Pushwoosh iOS SDK.