How to implement facebook like notification on cakephp?

前端 未结 1 1719
梦谈多话
梦谈多话 2020-12-28 10:22

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

相关标签:
1条回答
  • 2020-12-28 10:25

    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

    0 讨论(0)
提交回复
热议问题