fix: notifikasi in app jika isinya kosong
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user