feat: FCM HTTP v1 푸시 알림 발송 기능 구현

- google/auth 패키지 추가 (OAuth2 Service Account 인증)
- FcmSender: FCM HTTP v1 API 발송 서비스
- FcmResponse: 응답 DTO (성공/실패, 토큰 유효성 체크)
- FcmException: FCM 전용 예외 클래스
- fcm:test artisan 명령어 (테스트 발송)
- PushNotificationService에 FcmSender 연동
- config/fcm.php 설정 파일 추가
- 알림 유형별 채널 분리 (push_default, push_urgent)
This commit is contained in:
2025-12-18 22:06:26 +09:00
parent da7165a79f
commit 6e36d179a6
9 changed files with 735 additions and 11 deletions

65
config/fcm.php Normal file
View File

@@ -0,0 +1,65 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| FCM Project ID
|--------------------------------------------------------------------------
|
| Firebase 프로젝트 ID (Firebase Console에서 확인)
|
*/
'project_id' => env('FCM_PROJECT_ID'),
/*
|--------------------------------------------------------------------------
| Service Account JSON Path
|--------------------------------------------------------------------------
|
| Firebase Admin SDK 서비스 계정 JSON 파일 경로
| storage_path() 기준 상대 경로 또는 절대 경로
|
*/
'service_account_path' => env('FCM_SA_PATH', 'app/firebase-service-account.json'),
/*
|--------------------------------------------------------------------------
| FCM HTTP v1 Endpoint
|--------------------------------------------------------------------------
*/
'endpoint' => 'https://fcm.googleapis.com/v1/projects/{project_id}/messages:send',
/*
|--------------------------------------------------------------------------
| Android Notification Channels
|--------------------------------------------------------------------------
|
| 앱에서 정의된 알림 채널 ID 매핑
|
*/
'channels' => [
'default' => 'push_default',
'urgent' => 'push_urgent',
],
/*
|--------------------------------------------------------------------------
| Default Settings
|--------------------------------------------------------------------------
*/
'defaults' => [
'channel_id' => 'push_default',
'priority' => 'high',
'ttl' => '86400s', // 24시간
],
/*
|--------------------------------------------------------------------------
| Logging
|--------------------------------------------------------------------------
*/
'logging' => [
'enabled' => env('FCM_LOGGING_ENABLED', true),
'channel' => env('FCM_LOG_CHANNEL', 'stack'),
],
];