N
Novu11mo ago
bbaars

Mark all Push-Notifications as read.

Hello, I have integrated Novu in with a NodeJS backend which serves a React Native frontend. I am using push notifications with expo and have followed the docs around sending messages. I have successfully sent push notifications and built out the UI for showing the feed to the user via the
await this.novu.messages.list({
page: 0,
limit: 20,
channel: ChannelTypeEnum.PUSH,
subscriberId: subscriber.subscriberID,
});
await this.novu.messages.list({
page: 0,
limit: 20,
channel: ChannelTypeEnum.PUSH,
subscriberId: subscriber.subscriberID,
});
And the feed looks something like the image posted, where it shows an unread dot next to the notification. I am trying to "mark all messages as read" using the nodejs sdk. I have tried this:
await this.novu.subscribers.markAllMessagesAs(
subscriber.subscriberID,
MarkMessagesAsEnum.SEEN,
);
await this.novu.subscribers.markAllMessagesAs(
subscriber.subscriberID,
MarkMessagesAsEnum.SEEN,
);
However, this always returns { data: 0 } which I'm assuming is marking the in-app notifications as seen (which I don't have). Is there an endpoint that marks the push-notification channel as seen/read that I can utilize? Or am I going about this all wrong? I also tried integrating the HeadlessJS into the RN project, but ran into issue since it was trying to access localStorage and so I concluded it was web-only (unless there is a way to configure custom storage using AsyncStorage or something)
No description
2 Replies
Pawan Jain
Pawan Jain11mo ago
@bbaars 1. mark all seen feature is for in-app only 2. headless library has issue in react-native You can follow this gh issue for headless https://github.com/novuhq/novu/issues/4499
bbaars
bbaars11mo ago
Great, thank you!
Want results from more Discord servers?
Add your server