앱케이크_appcake_하이브리드앱제작_Admin.png

1.fcm 푸시발신 테스트 프로세스

⇒ 본 가이드는 맥os에서 fcm푸시발신 테스트를 진행하는 과정에 대한 가이드임.

⇒ 파이썬을 사용해 엑세스토큰을 발급받는다.

2.엑세스토큰 발급을 위한 파이썬 소스파일 생성

import google.auth.transport.requests
import google.oauth2.service_account

# fcm admin JSON 키 파일 다운로드 필요
SERVICE_ACCOUNT_FILE = 'adminsdk.json'  # 실제 파일/경로 설정

# 서비스 계정으로 JWT 자격 증명 생성
credentials = google.oauth2.service_account.Credentials.from_service_account_file(SERVICE_ACCOUNT_FILE,scopes=['<https://www.googleapis.com/auth/firebase.messaging>'])

# 엑세스 토큰 발급
auth_req = google.auth.transport.requests.Request()
credentials.refresh(auth_req)

# 발급된 엑세스 토큰 출력
print(credentials.token)

3.파이썬 설치

brew install python

4.파이썬 설치 확인

python3 --version