RE: Blurb Blurb - 29-Jan-2025

You are viewing a single comment's thread from:

Blurb Blurb - 29-Jan-2025

in blurt •  16 days ago 

thank you
Now implementing functionality on those menu items.

I need help with Notifications - How to fetch notifications? Don't we have an API for it? I implemented it but it is broke now.

I also need your suggestion - What should we show on explore menu item?

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE BLURT!
Sort Order:  
  ·  15 days ago  ·  

If you want to use the Nexus Notification system you can take a look here: https://dblurt.beblurt.com/classes/nexus.html

methods:

  • client.nexus.unreadNotifications to get the number of unread notifications
  • client.nexus.accountNotifications to get the unread notifications with pagination

To mark notifications as read you need to broadcast a custom_json operation

        /** Prepare data */
        const data: CustomJsonOperation['1'] = {
          id: 'notify',
          json: JSON.stringify(['setLastRead', { date: dayjs().utc().format('YYYY-MM-DDTHH:mm:ss')}]),
          required_auths: [],
          required_posting_auths: [this.userConnected],
        };
        const ops: Operation[] = [['custom_json', data]];
        await this.user.broadcast(ops);

Else you can use the notifications system of blurt.blog, in this case I invite you to ask @saboin

For the suggestion I think something about the more active Blurb user or most trending Blurbs but I don't know an easy way to do it

Thank you so much @nalexadre
This one really helps. We are indeed using dBlurt.
I'll pass this piece of information to my dev & let's see how it goes.
gif-1


Reply sent using [Blurt Comments](https://comments.blurt.blog)
  ·  15 days ago  ·  

Yeah. We’ve been using Nexus for notifications since we added community features to the frontends. What @nalexadre posted below should work if you’re using Dblurt.

Thank you @saboin for reply.
I'll look into what @nalexadre has posted & work on it.


Reply sent using [Blurt Comments](https://comments.blurt.blog)