iOS Live Activities API

Manage iOS Live Activities via API

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

NameTypeDescription

auth*

string

API access token from Pushwoosh Control Panel.

application*

string

Pushwoosh application code.

notifications*

array

JSON array of message parameters. See details in a request example below.

{
    "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
        "ios_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_push_tokens": [  // Required. List of live activity push tokens to update Live Activity.
      "00000e8cd558513943ced76f8816bde022a1a9c85fd181deb624476200069b237d38a56100fd4d992fab975000007cd2d32b48ab9f6152376aa4491533cfe99f579d7ecacf76f2a343fd0cd520404dd34d5ea22fcbf482a34dce92b89775ac585b7576e77a760e8cd558513943ced76f8816bde022a1a9c85fd181deb624476"
        ]
      }
    ]
  }
}

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

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

auth*

string

API access token from Pushwoosh Control Panel.

application*

string

Pushwoosh application code.

notifications*

array

JSON array of message parameters. See details in a request example below.

{

   "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
       "ios_live_activity": { // Required. Live Activity data to create Live Activity in iOS
         "content-state": {
            "emoji": ":wink:"
          },
          "attributes-type": "LiveActivityAttributes",
          "attributes": {
            "name": "Apple"
          }
       },
       "devices": [ // optional. Specify tokens or hwids to create live activity. Not more than 1000 tokens/hwids in an array. If set, the message will only be sent to the devices on the list. iOS push tokens can only be lower case.      "dec301908b9ba8df85e57a58e40f96f523f4c2068674f5fe2ba25cdc250a2a41"
       ],
 "filter": "FILTER_NAME", // optional
     }
   ]
 }
}

Last updated