Open Closed

Tracking which notifications have been read? #961


0
apexdodge created

I was wondering if anyone had a best practice for tracking which notifications have been read.

Let's assume you have a bubble at the top with the number of unread notifications, like on Facebook. image

Currently ABP supports subscribe / publish. But I can't find anywhere automatically built in for tracking which notifications have been read and which haven't.

Anyone do this with ABP's notification framework yet?

I'm thinking I add my own table ReadNotifications with the following columns:

Id UserId NotificationsId CreationTime

Then I only add a row to this table once a notification has been read for this user. If a notification Id along with the user Id does not appear in this table, then you can assume it was not read.

I feel like that is not the best way though? Is it a table scan every time you need to check if each notification was read or not? Could get really slow.

My other idea to add a column to the AbpUsers table:

UnreadNotificationsIds

Then comma separate the notification ids that have not been read there. But I feel this is also not clean? This would be faster than the first approach probably.

Looking for your thoughts.

Thanks!


2 Answer(s)
  • 0
    hole7 created

    Hi,

    As my little knowledge of abp -zero, it's already have a table for this stuff,

    SELECT * FROM [dbo].[AbpUserNotifications]

    You can use State column which has two values: 0 and 1 correspoding with UserNotificationSate enum of abp framework

    Thanks, Ho Le

  • 0
    hikalkan created

    Use IUserNotificationManager for it (http://www.aspnetboilerplate.com/Pages/ ... on-manager)