diff --git a/CHANGELOG.md b/CHANGELOG.md index 07393839..46a5e574 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines. +## [1.5.32](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.31...v1.5.32) (2026-01-05) + ## [1.5.31](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.30...v1.5.31) (2025-12-24) ## [1.5.30](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.29...v1.5.30) (2025-12-19) diff --git a/package.json b/package.json index 997829db..b6de4ec3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hipmi", - "version": "1.5.31", + "version": "1.5.32", "private": true, "prisma": { "seed": "bun prisma/seed.ts" diff --git a/src/app/api/mobile/notification/route.ts b/src/app/api/mobile/notification/route.ts index c98980c5..90b42061 100644 --- a/src/app/api/mobile/notification/route.ts +++ b/src/app/api/mobile/notification/route.ts @@ -108,10 +108,40 @@ export async function POST(request: NextRequest) { deepLink: deepLink || "", // contoh: senderId, type, etc. }, + // Konfigurasi Android untuk prioritas tinggi + android: { + priority: "high" as const, // Kirim secepatnya, bahkan di doze mode untuk notifikasi penting + notification: { + channelId: "default", // Sesuaikan dengan channel yang kamu buat di Android + // Opsional: sesuaikan icon & warna + // icon: 'ic_notification', + // color: '#FFD700', + }, + // FCM akan bangunkan app jika perlu + ttl: 0 as const, // Kirim secepatnya, jangan tunda + }, + // Opsional: tambahkan untuk iOS juga + apns: { + payload: { + aps: { + sound: "default" as const, + // 'content-available': 1 as const, // jika butuh silent push + }, + }, + }, }; - const response = await adminMessaging.send(message); - console.log("✅ FCM sent:", response); + try { + const response = await adminMessaging.send(message); + console.log( + "✅ FCM sent successfully", + "Response:", + response + ); + } catch (error: any) { + console.error("❌ FCM send failed:", error); + // Lanjutkan ke token berikutnya meski satu gagal + } } } else { return NextResponse.json({