NovuN
Novu3y 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,
});


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,
  );

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)
CleanShot_2023-10-24_at_13.20.062x.png
Was this page helpful?