Fri 11 Jan, 2019 03:19 am

you need to explain a bit clearly what you really want


Fri 11 Jan, 2019 05:01 am
What I'm taking about is something like how facebook sends individual notifications depending on actions to different users


Fri 11 Jan, 2019 12:27 pm
What you intend doing is bit tricky but let's take it a step at a time.
You like a photo
An entry is made into the notification db with details specifying your action(type of notification, who owns the photo, who liked the photo, when, has it been read).
On page loads(apps web or mobile) loads all notifications with pagination.
Unread notification is highlighted.
When notification icon is clicked, all unread notifications are updated in the db as read.
You can also monitor if a particular notification has been clicked this requires some extra logic, an entry in the db for each notification stating either clicked or not. This way, it is easy to distinguish which notification has actually been clicked on either read or not. This should b how you see some highlight in the notification panel that are not new.

I hope this helps


Sat 12 Jan, 2019 06:41 am
I understand these points
What I want is for these notifications to be pushed,

Like when the user is not on the website or app if a picture he or she has is liked a push notification is sent to him or her


Sat 12 Jan, 2019 07:57 am
Like someone stated in another post seniors create confusion with their grammars.

To push you either need socket implementation or a real time long polling of the server.

When you app notices internet connection, it calls the notification endpoint at intervals seeking if there are new updates, if they are, add a new notification with the details of the latest pulled ones. Of they are not ignore. That is long polling somehow, look into network tab of Facebook and see there are some calls that are made after a variant of the call has resolved. This keeps it real time.

With socket, clients connect to the server on a port, when a user likes a photo, you publish a new event to the connected clients, the clients receives and acts on the newly received data.

Simply, use socket or long polling. And make sure your app calls the notification endpoint when internet is noticed to show new ones in the drawer.