upd: penerapan firebase

Deskripsi:
- pengumuman
- diskusi umum
- diskusi divisi
- divisi
- kegiatan
- tugas divisi

No Issues
This commit is contained in:
2025-07-09 16:42:05 +08:00
parent 2e9a5bcd74
commit adf8fcf8f6
9 changed files with 215 additions and 35 deletions

View File

@@ -22,7 +22,7 @@ export async function sendFCMNotificationMany({ token, title, body, data }: { to
title,
body,
},
token,
tokens:token,
data,
android: {
priority: "high",
@@ -42,10 +42,7 @@ export async function sendFCMNotificationMany({ token, title, body, data }: { to
};
// Kirim pesan
const response = await getMessaging().sendEachForMulticast({
tokens: token,
...message,
} as any);
const response = await getMessaging().sendEachForMulticast(message as any);
if (response.failureCount > 0) {
const failedTokens: any[] = [];
response.responses.forEach((resp, idx) => {
@@ -59,6 +56,5 @@ export async function sendFCMNotificationMany({ token, title, body, data }: { to
return { success: true, message: "Notifikasi berhasil dikirim", };
} catch (error) {
console.error("Error mengirim notifikasi:", error);
throw error;
}
}