如何在PHP中实现推送通知 [英] How to Implement Push Notifcation in PHP

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

问题描述

我已经和ajax合作了一段时间了,我已经用它做了很多漂亮的工作..但是我最近的挑战是关于推送通知。

I have been working with ajax for a while now, and I have used it to do a lot of nifty jobs.. But then my recent challenge has been on push notification.

我想实现一个不需要在每个时间段内调用服务器的站点,而只是在特定数据库字段有更新时才调用服务器,我想要在PHP,javascript和/或jquery或任何其他Web技术中实现这一点。我不知道如何去做,或者甚至可能。

I want to implement a site that would not need to make a call to the server every period of time, but rather would make a call to the server only when there is an update on a particular DB field, and I want to implement this in PHP, javascript and/or jquery or any other technology for the web. I do not have any idea as to how to go about it, or if it is even possible.

我想知道在何处以及如何开始的指示,谢谢大家。 ....

I would like directions on where and how to start, Thanks all.....

推荐答案

由于WebSocket支持尚未完全支持,您可能希望重新进行长轮询。似乎已经有一个jQuery插件:

Since WebSocket support isn't quite there yet, you would want to fall back on long polling. There already seems to be a jQuery plugin for this:

https://code.google.com/p/jquery-graceful-websocket/

这个主题的一个很好的幻灯片可以在这里找到 http://www.slideshare.net/ffdead/the-html5- websocket-api

A nice slide on this subject can be found here http://www.slideshare.net/ffdead/the-html5-websocket-api

要在PHP中实现WebSockets,请查看 https://code.google.com/p/phpwebsocket/

To implement WebSockets in PHP, have a look at https://code.google.com/p/phpwebsocket/

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

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