2

I've noticed that on the web view of devRant, the notification counter updates in real time.

So I opened up the Inspect Element and checked for any polling related code (Socket.io) or something.

What I found was that this endpoint is called on a loop -> https://devrant.com/api/devrant/...

And the response format contains ->
{
"success": true,
"rants": [],
"settings": {
"notif_state": -1,
"notif_token": ""
},
"set": "64d68f5a7acd4",
"wrw": 376,
"dpp": 0,
"num_notifs": 0,
"unread": {
"total": 0
}
}

I assume `num_notifs` is the notification counter.

So, my question is is this practice good for implementing real time notifications?

Comments
Add Comment