134
Views
3
Comments
Notifications Hub
Application Type
Reactive

Hey guys,

I'm looking to implement a notifications hub that would work very similar to the facebook bell icon.

The user would receive a number of notifications (stored in the database) . On pressing an icon on the header, the user would be able to see the notifications he got and mark them as read.

Is there any module that already does something similar to this? If not do you have any tips on how to do this in terms of best practices?

2021-07-19 14-21-08
Carlos Alfradique

Hi João, 

You can try using this component
https://www.outsystems.com/forge/component-overview/14565/notifications-bar


Best Regards.

UserImage.jpg
Fabiano Peralta

Hello João,

There aren't modules that do exactly what you you're looking for. But here are some tips in terms of best practises.

1. Use a database table to store notifications. The table should include columns for the user ID, notification message, timestamp, and read status.

2. Create a REST API to retrieve the notifications for a given user. The API should take the user ID as a parameter and return a list of unread notifications.

3. Use the OutSystems notifications component to display the notifications to the user.

4. When the user clicks on the notification icon, call the REST API to retrieve the list of unread notifications for the user. Display the notifications in a pop-up or dropdown menu.

5. Allow the user to mark notifications as read. When a notification is marked as read, update the corresponding record in the database.

Regards

2021-03-05 13-56-11
Ricardo Pereira
 
MVP

Hi Fabiano,

Just one point about  using UserIds in APIs: It's better to use tokens, because, the data in rest (not REST service, but data that comes from the services and stay in the devices) can be manipulated and, UserId can be guessable and randomizable (p.e., if you have 2031, I will try 2032, 2033, 2030, 2029 and so on).

But, it's just an opinion taking in consideration the cybersecurity violations that are occurring these days.


Best regards,

Ricardo PEreira

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.