# Android FCM 연동

## Firebase Cloud Messaging (FCM)

Firebase Cloud Messaging은 구글이 공식적으로 제공하는 안드로이드 푸시 채널입니다. 이를 통해 안드로이드 앱에 안정적이고 신속한 푸시 알림 서비스를 제공할 수 있습니다.

***

푸시 알림에는 Firebase 프로젝트가 필요합니다. 그리고 핵클은 Firebase Cloud Messaging V1 API를 이용해 푸시를 발송합니다.

아래 가이드를 따라 Firebase 프로젝트 세팅 및 푸시키를 생성해주세요.

{% stepper %}
{% step %}
**Firebase 프로젝트 만들기**

(이미 Firebase 프로젝트가 있는 경우 다음 단계로 건너 뜁니다.)

![Firebase 프로젝트 페이지](/files/ZOBZqc80c2m1upnZQC54)
{% endstep %}

{% step %}
**Firebase Cloud Messaging API(V1) 활성화 확인**

방금 새로운 프로젝트를 생성한 경우 기본적으로 활성화 되어 있으므로 이 단계를 건너 뛸 수 있습니다. 하지만 이전에 생성한 Firebase 프로젝트를 사용하는 경우 Firebase Cloud Messaging API(V1)가 활성화 되어있는지 확인이 필요합니다.

'프로젝트 개요' 옆에있는 톱니바퀴 아이콘을 클릭하고 **프로젝트 설정**을 선택합니다. 프로젝트 설정 페이지에서 **클라우드 메시징** 탭을 선택합니다

![Firebase 프로젝트 설정](/files/FihuZ0foQV39KAvrhYKx)

\*\*Firebase Cloud Messaging API(V1)\*\*가 비활성화되어있는 경우 오른쪽 상단 아이콘을 클릭하고 API 관리페이지로 들어갑니다.

![Firebase Cloud Messaging API(V1) 비활성화된 경우](/files/oq7m7uRsIFOx7jarK1Ds)

**사용** 버튼을 클릭합니다.

![Firebase Cloud Messaging API(V1) 을 활성화 합니다](/files/wcsD2KVgtSReHBleNdLd)
{% endstep %}

{% step %}
**비공개 키 JSON 파일 생성**

프로젝트 설정에서 **서비스 계정** 탭으로 이동합니다.

페이지 하단의 **새 비공개 키 생성**을 클릭합니다

![서비스 계정 탭" align="center" src="../../.gitbook/assets/0ea49d3-\_2024-01-31\_11.29.22\_98791c9aad4735d9.png">
Firebase 프로젝트 설정 > 서비스 계정 탭](/files/aakYskkg8yKRxea3U1cU)

이후 **키 생성**을 클릭합니다

![](/files/sbFurnLibbOI41FSvjyK)

JSON 파일을 안전한 곳에 저장하세요. 곧 사용해야 합니다.

{% hint style="info" %}
필수 권한

푸시 알림이 작동하려면 다음 서비스 계정 권한이 필요합니다

* `cloudmessaging.messages.create`
* `firebase.projects.get`
  {% endhint %}
  {% endstep %}

{% step %}
**핵클 대시보드에 Android 푸시 설정**

핵클 대시보드에서 **설정 > 외부연동** 탭에서 \*\*Android 푸시 메세지 (FCM)\*\*의 연동하기 버튼을 클릭합니다.

![핵클 대시보드 푸시 연동 페이지](/files/0QCPjD70Jf7Np7hNQl5C)

3번 단계에서 다운로드 받은 JSON 파일을 선택하고 저장합니다.

![](/files/mUtQXZxVvSO95DUTgIgW)
{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hackle.io/external-link/crm-channels/fcm-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
