> For the complete documentation index, see [llms.txt](https://docs.dfinery.ai/developer-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dfinery.ai/developer-guide/common/specification/android-push-payload.md).

# Android 푸시 페이로드

이 문서는 Android 단말기에서 수신 받는 푸시 페이로드에 대해 서술합니다.

푸시 수신 이벤트는 [FirebaseMessagingService](https://firebase.google.com/docs/reference/kotlin/com/google/firebase/messaging/FirebaseMessagingService)을 상속받은 객체의 `onMessageReceived(RemoteMessage remoteMessage)`를 통해 전달됩니다.

Dfinery는 FCM message 타입 중 [데이터 메시지](https://firebase.google.com/docs/cloud-messaging/concept-options#data_messages)만을 사용하며 **`dfn`** 키 값에 JSON String 형태로 푸시 페이로드를 전달받게 됩니다.

```json
dfn = "{...}"
```

## Push Payload

[remoteMessage.getData()](https://firebase.google.com/docs/reference/kotlin/com/google/firebase/messaging/RemoteMessage#data\(\)) 내 **`dfn`** 키 값의 JSON String에 대한 명세입니다.

| 이름         | 타입      | 설명                                 |
| ---------- | ------- | ---------------------------------- |
| tit        | string  | 알림 제목                              |
| bd         | string  | 알림 본문 텍스트                          |
| img        | string  | 알림에 보이게 될 이미지 URL                  |
| is\_f      | integer | 포그라운드시 노출 여부 (`1`:true,`0`:false)  |
| is\_v      | integer | 수신시 진동 재생 여부 (`1`:true,`0`:false)  |
| is\_r      | integer | 수신시 알림음 재생 여부 (`1`:true,`0`:false) |
| n\_id      | integer | 알림 ID                              |
| click\_act | object  | 푸시 알림 클릭시 동작                       |
| btn        | array   | 푸시 알림 버튼 클릭시 동작                    |
| ads        | object  | 광고 푸시 정보                           |
| imp        | integer | 노출 측정 여부 (`1`:true,`0`:false)      |
| u\_id      | string  | 통합 ID                              |
| is\_test   | integer | 테스트 푸시 여부 (`1`:true,`0`:false)     |

```json
{
   "tit":"푸시 알림 제목",
   "bd":"푸시 알림 내용",
   "img":"https://sampleimages.com/btz60qfdqeg7vrpcsk0o8x.jpeg",
   "is_f":1,
   "is_v":1,
   "is_r":1,
   "n_id":1715243891,
   "click_act":{
      "l_id":"1",
      "l_type":"Content",
      "act_type":"Deeplink",
      "uri":"dfinery://pushlist"
   },
   "btn":[
      {
         "l_id":"1",
         "l_name":"app open",
         "l_type":"Button",
         "act_type":"AppOpen",
         "uri":""
      },
      {
         "l_id":"2",
         "l_name":"deeplink",
         "l_type":"Button",
         "act_type":"Deeplink",
         "uri":"dfinery://pushlist"
      }
   ],
   "ads": {
	    "i_url": [
		    "https://imp-1.url",
		    "https://imp-2.url"
	    ],
	    "c_url": [
		    "https://click-1.url"
	    ]
    },
   "imp": 1, 
   "u_id":"vavgmzx",
   "is_test":1
}
```

## Click Action

`click_act` Object에 대한 명세입니다.

| 이름        | 타입     | 설명                |
| --------- | ------ | ----------------- |
| act\_type | string | 클릭시 액션 타입         |
| uri       | string | 웹 URL 혹은 딥링크 URI  |
| l\_id     | string | Location ID (내부용) |
| l\_type   | string | Location 타입 (내부용) |

```json
"click_act":{
    "l_id":"1",
    "l_type":"Content",
    "act_type":"Deeplink",
    "uri":"dfinery://pushlist"
}
```

## Button

`btn` Array에 대한 명세입니다.

| 이름        | 타입     | 설명                |
| --------- | ------ | ----------------- |
| l\_name   | string | 버튼 텍스트            |
| act\_type | string | 클릭시 액션 타입         |
| uri       | string | 웹 URL 혹은 딥링크 URI  |
| l\_id     | string | Location ID (내부용) |
| l\_type   | string | Location 타입 (내부용) |

```json
"btn":[
    {
        "l_id":"1",
        "l_name":"app open",
        "l_type":"Button",
        "act_type":"AppOpen",
        "uri":""
    },
    {
        "l_id":"2",
        "l_name":"deeplink",
        "l_type":"Button",
        "act_type":"Deeplink",
        "uri":"dfinery://pushlist"
    }
]
```

## Advertising

`ads` Object에 대한 명세입니다.

| 이름     | 타입    | 설명              |
| ------ | ----- | --------------- |
| i\_url | array | 노출시 partner url |
| c\_url | array | 클릭시 partner url |

```json
"ads": {
   "i_url": [
      "https://imp-1.url",
      "https://imp-2.url"
   ],
   "c_url": [
      "https://click-1.url"
   ]
}
```
