如何在cakephp上实现Facebook的通知? [英] How to implement facebook like notification on cakephp?

查看:155
本文介绍了如何在cakephp上实现Facebook的通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何实现Facebook通知吗?这个想法是在与数据库中进行的更改并行的选项卡上放置通知,而不刷新站点?如果数据被添加到数据库中,则该站点应该对其进行反应。谢谢!欢呼声!

解决方案

使用实时Web技术,如Comet服务器或WebSocket服务器。可以将此功能直接添加到PHP应用程序中,但广泛认为PHP不会很好地处理持久/长期连接(不会扩展)。如果您仍然希望托管自己的实时PHP解决方案,请点击以下资源:





然而,我会建议您查看托管解决方案(我工作一家这样的公司)这意味着您需要做的是对RESTful API进行HTTP调用,并在应用程序中嵌入JavaScript库以实现推送通知。更多信息为什么我建议在此 Apache和Comet中的SO问题


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!

解决方案

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:

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

这篇关于如何在cakephp上实现Facebook的通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆