iOS Live Activities API

Manage iOS Live Activities via API

startLiveActivity

Use this method to create iOS Live Activities.

POST https://api.pushwoosh.com/json/1.3/startLiveActivity

Allows to create iOS Live Activities.

Request body

Notifications

Parameters used in the notifications array.

{

   "status_code": 200,
   "status_message": "OK",
   "response": {
       "Messages": [
           "C3F8-C3863ED4-334AD4F1" // message code
       ]
   }
}

Request example

 {
  "request": {
    "application": "XXXXX-XXXXX", // Required. Pushwoosh application code
    "auth": "yxoPUlwqm…………pIyEX4H", // Required. API access token from Pushwoosh Control Panel
    "notifications": [
      {
        // message settings
        "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": "69153b33-XXXX-40a8-XXXX-9372890790c3", // Unique identifier of the Live Activity.
        "filter_code": "FILTER_NAME", // optional. Specify filter.
        "devices": [ // optional. Specify tokens or hwids to send targeted push notifications. Not more than 1000 tokens/hwids in an array. If set, the message will only be sent to the devices on the list. Application Group for devices list is not allowed. iOS push tokens can only be lower case.
          "dec301908b9ba8XXXXXXXX58eXXXXXXXX3f4c20686XXXXXXXXa25cdc250a2a41"
        ],
        "users": [ // optional. If set, message will only be delivered to the specified user ID's (set via /registerUser call). If specified together with devices parameter, the latter will be ignored. Not more than 1000 user ID's in an array. Application Group for users list is not allowed.
          "user_XXXXa"
        ]
      }
    ]
  }
}

updateLiveActivity

Use 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

Notifications

Parameters used in the notifications array.

{
    "status_code": 200,
    "status_message": "OK",
    "response": {
        "Messages": [
            "C3F8-C3863ED4-334AD4F1" // message code
        ]
    }
}

Request example

Example
{
  "request": {
    "application": "XXXXX-XXXXX", // Required. Pushwoosh application code
    "auth": "yxoPUlwqm…………pIyEX4H", // Required. API access token from Pushwoosh Control Panel
    "notifications": [
      {
        // message settings
        "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 to Live Activity for updating its content
            "courierName": "NUMBER: 15",
            "deliveryStatus": "Done"
          },
          "dismissal-date": 12345678 // Optional. Time of ending Live Activity in seconds
        },
        "live_activity_id": "69153b33-XXXX-40a8-XXXX-9372890790c3", // Unique identifier of the Live Activity.
      }
    ]
  }
}

Read this article to learn more about working with Live Activities using the Pushwoosh iOS SDK.

Last updated