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