Monday, 19 March 2018

Best practice for adding "notifications" to a site?

I'm making a dating site.Imagine James "hearts" Sally's profile. I want a simple notification for Sally next time she logs in. Kinda like facebook.My current idea is having both:{"hearts": [james, fred, george]} {"newHearts": [james]}objects in the users mongo database. And every time an item gets added to hearts it also gets added to newHearts. Then when a user acknowledges the "newHeart" i remove the item and the array is empty again?I've never done notifications before so wasn't sure there is a best practice? Bear in mind I also want to add in similar notifications for messaging later. So may be worth considering that. Thank you for any help!

Submitted March 19, 2018 at 02:08PM by harrydry

No comments:

Post a Comment