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,15 +37,17 @@ export default function RootLayout() {
const id = remoteMessage?.data?.id;
const category = remoteMessage?.data?.category;
const content = remoteMessage?.data?.content;
Notifier.showNotification({
title: remoteMessage.notification?.title,
description: remoteMessage.notification?.body,
duration: 3000,
animationDuration: 300,
showEasing: Easing.ease,
onPress: () => handleReadNotification(String(id), String(category), String(content)),
hideOnPress: true,
});
if (remoteMessage.notification != undefined && remoteMessage.notification.title != undefined && remoteMessage.notification.body != undefined) {
Notifier.showNotification({
title: remoteMessage.notification?.title,
description: remoteMessage.notification?.body,
duration: 3000,
animationDuration: 300,
showEasing: Easing.ease,
onPress: () => handleReadNotification(String(id), String(category), String(content)),
hideOnPress: true,
});
}
});
return unsubscribe;