PHP - 推送通知

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5452779/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 21:29:07  来源:igfitidea点击:

PHP - Push Notifications

php

提问by MKN Web Solutions

What methods can be used to make PHP capable of becoming a push notification server?

可以使用哪些方法使 PHP 能够成为推送通知服务器?

采纳答案by CoolStraw

You might like this: http://blog.boxedice.com/2009/07/10/how-to-build-an-apple-push-notification-provider-server-tutorial/

你可能喜欢这个:http: //blog.boxedice.com/2009/07/10/how-to-build-an-apple-push-notification-provider-server-tutorial/

In few words: Push notifications mean the client becomes the server and vice versa; in fact all you need is a client that listens, and a server that queries those clients listed somewhere. Some servers exist, there's this one for real time notification that's used with statusnetI just can't remember its name right now. Maybe it can help, whenever I come across the name back I'll get back to ya. Meanwhile, read the tutorial above it might give you some gold ideas.

简而言之:推送通知意味着客户端成为服务器,反之亦然;事实上,您所需要的只是一个侦听的客户端,以及一个查询某处列出的那些客户端的服务器。存在一些服务器,有一个用于与statusnet 一起使用的实时通知,我现在不记得它的名字了。也许它会有所帮助,每当我遇到这个名字时,我都会回复你。同时,阅读上面的教程,它可能会给你一些金点子。

edit

编辑

The real time server is called Meteor.

实时服务器称为 Meteor。

There are a lot of these: http://status.net/wiki/Realtime

有很多这样的:http: //status.net/wiki/Realtime

回答by ggarber

You should use a specific HTTP Push server to maintain permanent connections with the clients (the browsers) and then send the events from your PHP code or backend systems to that HTTP Push server for the delivery to those clients.

您应该使用特定的 HTTP 推送服务器来保持与客户端(浏览器)的永久连接,然后将事件从您的 PHP 代码或后端系统发送到该 HTTP 推送服务器以交付给这些客户端。

There are a lot of technologies and server implementations for that kind of HTTP push servers. You can find a lot of information with a google search or you can take a look for example at socket.io.

这种 HTTP 推送服务器有很多技术和服务器实现。你可以通过谷歌搜索找到很多信息,或者你可以看看socket.io 的例子。