iOS Live Activities API
Apple 문서:
startLiveActivity
Anchor link to이 메서드를 사용하여 iOS Live Activities를 생성합니다.
POST https://api.pushwoosh.com/json/1.3/startLiveActivity
iOS Live Activities 생성을 허용합니다.
Request body
Anchor link to| Parameter | Type | Required/Optional | Description |
|---|---|---|---|
| application | String | Required | Pushwoosh 애플리케이션 코드 |
| auth | String | Required | Pushwoosh Control Panel의 API 액세스 토큰. |
| notifications | Array | Required | 메시지 파라미터의 JSON 배열입니다. 아래 Notifications 표에서 세부 정보를 참조하십시오. |
Notifications
Anchor link tonotifications 배열에 사용되는 파라미터:
| Parameter | Type | Required/Optional | Description |
|---|---|---|---|
| content | String | Required | Live Activity를 지원하지 않는 iOS 16.1 미만 버전의 기기를 위한 대체 콘텐츠입니다. iOS 16.1 이상(Live Activity 지원)에서는 live_activity 필드에서 콘텐츠를 가져옵니다. |
| title | String | Optional | 알림 메시지의 제목입니다. |
| live_activity | Object | Required | iOS에서 Live Activity를 생성하기 위한 Live Activity 데이터입니다. |
| content-state | Object | Required | Live Activity 알림을 위한 콘텐츠입니다. |
| attributes-type | String | Required | Live Activity에 사용되는 속성(attributes) 유형입니다. |
| attributes | Object | Required | Live Activity를 위한 속성입니다. |
| live_activity_id | String | Required | 사용자가 생성한 Live Activity의 고유 ID입니다. |
| filter_code | String | Optional | 특정 타겟 오디언스 세그먼트를 위한 필터(세그먼트) 코드입니다. |
| devices | Array of strings | Optional | 타겟 푸시 알림을 보내기 위한 토큰 또는 HWID이며, 최대 1000개까지 가능합니다. 설정된 경우, 메시지는 목록에 있는 기기로만 전송됩니다. 참고: 기기 목록에 대한 Application Group은 허용되지 않으며, iOS 푸시 토큰은 소문자여야 합니다. |
| users | Array of strings | Optional | 설정된 경우, 메시지는 지정된 User ID(/registerUser 호출을 통해 할당됨)로만 전달됩니다. 배열에 최대 1000개의 User ID를 포함할 수 있습니다. 참고: devices 파라미터와 함께 사용되는 경우, users 파라미터가 우선합니다. 사용자 목록에 대한 Application Group은 허용되지 않습니다. |
Response
Anchor link to200
{ "status_code": 200, "status_message": "OK", "response": { "Messages": [ "C3F8-C3863ED4-334AD4F1" ] }}Request example
Anchor link to{ "request": { "application": "XXXXX-XXXXX", // 필수. Pushwoosh 애플리케이션 코드 "auth": "yxoPUlwqm…………pIyEX4H", // 필수. Pushwoosh Control Panel의 API 액세스 토큰 "notifications": [{ "live_activity": { // 필수. iOS에서 Live Activity를 생성하기 위한 Live Activity 데이터 "content-state": { "emoji": ":wink:" }, "attributes-type": "LiveActivityAttributes", "attributes": { "name": "Apple" } }, "live_activity_id": "unique UUID", // 선택. Live Activity의 고유 식별자. "filter_code": "FILTER_NAME", // 선택. 필터 지정. "devices": [ // 선택. 타겟 푸시 알림을 보낼 토큰 또는 hwid 지정. "hwid_XXXX" // 배열에 최대 1000개의 토큰/hwid 포함 가능. ], // 설정된 경우, 메시지는 목록에 있는 기기로만 전송됩니다. // 기기 목록에 대한 Application Group은 허용되지 않습니다. // iOS 푸시 토큰은 소문자만 가능합니다. "users": [ // 선택. 설정된 경우, 메시지는 지정된 User ID로만 전달됩니다 "user_XXXX" // (/registerUser 호출을 통해 설정됨). devices 파라미터와 ] // 함께 지정된 경우, devices는 무시됩니다. 배열에 최대 1000개의 // User ID 포함 가능. 사용자 목록에 대한 Application Group은 // 허용되지 않습니다. }] }}참고:
Pushwoosh iOS SDK를 사용하여 Live Activities로 작업하는 방법에 대해 자세히 알아보려면 이 문서를 읽어보십시오.
updateLiveActivity
Anchor link to이 메서드를 사용하여 iOS Live Activities를 관리합니다.
POST https://api.pushwoosh.com/json/1.3/updateLiveActivity
iOS Live Activities를 생성하고 관리할 수 있습니다.
Request body
Anchor link to| Parameter | Type | Required/Optional | Description |
|---|---|---|---|
| auth | String | Required | Pushwoosh Control Panel의 API 액세스 토큰. |
| application | String | Required | Pushwoosh 애플리케이션 코드 |
| notifications | Array | Required | 메시지 파라미터의 JSON 배열입니다. 아래 Notifications 표에서 세부 정보를 참조하십시오. |
Notifications
Anchor link tonotifications 배열에 사용되는 파라미터:
| Parameter | Type | Required/Optional | Description |
|---|---|---|---|
| live_activity | Object | Required | iOS에서 Live Activity를 업데이트하기 위한 Live Activity 데이터입니다. |
| event | String | Required | 이벤트 유형을 지정합니다. Live Activity를 업데이트하려면 "update"를, 종료하려면 "end"를 사용하십시오. |
| content-state | Object | Required | 콘텐츠를 업데이트하기 위해 Live Activity에 데이터를 전달하는 데 사용되는 키-값 쌍이 있는 객체입니다. |
| dismissal-date | Integer | Optional | Live Activity가 종료되어야 하는 시간(초)입니다. |
| live_activity_id | String | Required | 업데이트 중인 Live Activity의 고유 식별자입니다. |
| stale-date | Integer | Optional | Live Activity가 stale(오래된) 상태가 되거나 만료되는 날짜를 나타내는 시간(초)입니다. |
{ "status_code": 200, "status_message": "OK", "response": { "Messages": [ "C3F8-C3863ED4-334AD4F1" ] }}Request example
Anchor link to{ "request": { "application": "XXXXX-XXXXX", // 필수. Pushwoosh 애플리케이션 코드 "auth": "yxoPUlwqm…………pIyEX4H", // 필수. Pushwoosh Control Panel의 API 액세스 토큰 "notifications": [{ "live_activity": { // 필수. iOS에서 Live Activity를 업데이트하기 위한 Live Activity 데이터 "event": "update", // 필수. Live Activity를 업데이트하려면 "update", // 종료하려면 "end" 사용 "content-state": { // 필수. 콘텐츠를 업데이트하기 위해 Live Activity에 데이터를 "courierName": "NUMBER: 15", // 전달하는 데 사용되는 키-값 쌍이 있는 객체 "deliveryStatus": "Done" }, "dismissal-date": 12345678, // 선택. Live Activity 종료 시간(초) "stale-date": 23456789 // 선택. Live Activity가 stale 상태가 되는 시간(초) }, "live_activity_id": "unique UUID" // 선택. Live Activity의 고유 식별자. }] }}Pushwoosh iOS SDK를 사용하여 Live Activities로 작업하는 방법에 대해 자세히 알아보려면 이 문서를 읽어보십시오.