Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement facebook like notification on cakephp?

does somebody knows how to implement facebook like notification? the idea is to put notification on the tabs parallel to the changes made in the database without refreshing the site? if a data is added to the database, the site should react on it. thank you.. cheers!

like image 233
unknown Avatar asked Oct 08 '11 12:10

unknown


1 Answers

Facebook style notifications are achieved in web applications using realtime web technologies such as Comet servers or WebSocket servers. It is possible to add this functionality directly into a PHP application but it's widely agreed that PHP doesn't handle persistent/long-held connections very well (it won't scale). If you still want to host your own realtime PHP solution here are a few resources:

  • StackOverflow question about AJAX PHP Push
  • phpwebsocket
  • Start using HTML5 WebSockets today
  • php-websocket
  • How to implement Comet in PHP

However, I'd recommend you look at a hosted solution (I work for one such company) which means all you need to do is make a HTTP call to a RESTful API and embed a JavaScript library within your application to achieve your push notifications. More information why I recommend using a hosted service in this SO question on Apache and Comet

like image 145
leggetter Avatar answered Sep 28 '22 15:09

leggetter