fix: notifikasi in app jika isinya kosong

This commit is contained in:
2025-07-10 11:58:47 +08:00
parent 2adb1bfd07
commit ff46f191e0

View File

@@ -37,6 +37,7 @@ export default function RootLayout() {
const id = remoteMessage?.data?.id; const id = remoteMessage?.data?.id;
const category = remoteMessage?.data?.category; const category = remoteMessage?.data?.category;
const content = remoteMessage?.data?.content; const content = remoteMessage?.data?.content;
if (remoteMessage.notification != undefined && remoteMessage.notification.title != undefined && remoteMessage.notification.body != undefined) {
Notifier.showNotification({ Notifier.showNotification({
title: remoteMessage.notification?.title, title: remoteMessage.notification?.title,
description: remoteMessage.notification?.body, description: remoteMessage.notification?.body,
@@ -46,6 +47,7 @@ export default function RootLayout() {
onPress: () => handleReadNotification(String(id), String(category), String(content)), onPress: () => handleReadNotification(String(id), String(category), String(content)),
hideOnPress: true, hideOnPress: true,
}); });
}
}); });
return unsubscribe; return unsubscribe;