I am trying to implement a Facebook-like live notifications system to notify users whenever someone adds them as friend, like their post or posts replies to their comments.
All the database and PHP part is done, but I can't figure out how to implement it like Facebook has.
Whenever someone likes/comments on your post in Facebook the light blue box appears at the bottom left corner of the screen. This happens as soon as someone hits like button or posts comment in Facebook. I would like to know what I should do to implement this.
Using YUI or any JavaScript framework I can query a database table after n
seconds to check for notifications. This method is too heavy.
I was wondering if there is any server side mod or scripting can be done so that whenever there is new notification entry in my database table the server will tell that particular client. That way unnecessary request calls from client to server will be avoided completely and system can work efficiently for website with more than 50,000 users online at a time.
How can I achieve this?
Tap in the top right of Facebook, then tap your name. Tap Settings. Tap Notification Settings or Text Messaging below Notifications. Tap to adjust how you get notifications and what you get notified about.
That notification will immediately be added to the top of their “Notifications” list. If they already had Facebook open when you “Liked” the post, they'll see the notification that you “liked” it when they view their notifications even if you have already “unliked” it before they click to view their notifications.
Push notifications: sent when you're not actively using Facebook (example: on your device's lockscreen). In-app notifications: sent when you're using Facebook. These show up as numbers over the in Facebook's navigation, or over the Facebook app on your phone.
Just navigate to a friend's Facebook profile page and look for the “Friends” button floating over their cover photo. Click the button to pull up the drop down menu and select either “Get Notifications” or “Close Friends”, depending on your preference.
You should look into COMET techniques, such as forever frame (tutorial) and long polling. That allows you to have a form of a server->client push communication.
I am really surprised nobody has mentioned PubNub and Pusher
These two (competitors) are building infrastructure which allows for realtime notifications, just like Facebook.
Facebook notification
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With