feat: FCM 실서비스 확장 - 대량 발송 및 무효 토큰 관리

- FcmSender.sendToMany() 추가 (chunk/rate limit 지원)
- FcmBatchResult 클래스 추가 (발송 결과 집계)
- fcm:send 명령어 추가 (대량 발송, dry-run 지원)
- fcm:prune-invalid 명령어 추가 (무효 토큰 정리)
- PushDeviceToken에 last_error, last_error_at 컬럼 추가
- 실패 토큰 자동 비활성화 (UNREGISTERED, NOT_FOUND, INVALID_ARGUMENT)
This commit is contained in:
2025-12-18 23:01:06 +09:00
parent 81a6dfab5a
commit 10a64fb0a5
9 changed files with 509 additions and 8 deletions

View File

@@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('push_device_tokens', function (Blueprint $table) {
$table->string('last_error', 100)->nullable()->after('is_active')->comment('마지막 FCM 에러 코드');
$table->timestamp('last_error_at')->nullable()->after('last_error')->comment('마지막 에러 발생 시각');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('push_device_tokens', function (Blueprint $table) {
$table->dropColumn(['last_error', 'last_error_at']);
});
}
};