Get account notifications
Get account notifications in Bitsocial React Hooks. Usage, options, and examples.
const { notifications, markAsRead } = useNotifications();
for (const notification of notifications) {
console.log(notification);
}
await markAsRead();
const johnsNotifications = useNotifications({ accountName: "John" });
for (const notification of johnsNotifications.notifications) {
console.log(notification);
}
await johnsNotifications.markAsRead();
// get the unread notification counts for all accounts
const { accounts } = useAccounts();
const accountsUnreadNotificationsCounts = accounts?.map(
(account) => account.unreadNotificationCount,
);