- FCM 토큰 관리 페이지 (목록, 활성화/비활성화, 삭제) - 테스트 발송 페이지 (대상 필터, 미리보기, 발송) - 발송 이력 페이지 (필터링, 결과 확인) - FcmSender 서비스 (HTTP v1, 배치 처리) - fcm_send_logs 테이블 마이그레이션 - google/auth 패키지 추가
28 lines
631 B
PHP
28 lines
631 B
PHP
<?php
|
|
|
|
namespace App\Services\Fcm;
|
|
|
|
use Exception;
|
|
|
|
class FcmException extends Exception
|
|
{
|
|
public function __construct(
|
|
string $message,
|
|
public readonly int $httpStatusCode = 0,
|
|
public readonly array $response = [],
|
|
?\Throwable $previous = null
|
|
) {
|
|
parent::__construct($message, 0, $previous);
|
|
}
|
|
|
|
/**
|
|
* HTTP 응답에서 예외 생성
|
|
*/
|
|
public static function fromResponse(int $statusCode, array $response): self
|
|
{
|
|
$message = $response['error']['message'] ?? 'Unknown FCM error';
|
|
|
|
return new self($message, $statusCode, $response);
|
|
}
|
|
}
|