What methods can be used to make PHP capable of becoming a push notification server?
-
1Check this answer as well: http://stackoverflow.com/questions/5292247/push-notifications-server-implementation – anubhava Mar 27 '11 at 22:06
-
Something interesting to do is use Firebug and watch how Facebook does it's "push" notifications. – Jared Farrish Mar 27 '11 at 22:23
-
For PHP Push Notification automate visit https://ampersandacademy.com/tutorials/ionic-framework-version-2/push-notification-automate-using-php – Bharathiraja Apr 17 '17 at 07:48
2 Answers
You might like this: 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 statusnet I 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.
edit
The real time server is called Meteor.
There are a lot of these: http://status.net/wiki/Realtime

- 5,282
- 8
- 42
- 64
-
1Hmm, It looks like, using the php functions: stream_socket_client / stream_socket_server might be able to do this. I'm assuming they just create a connection and hold the connection. – Michael Mikhjian Mar 27 '11 at 22:13
-
I'm not quite sure about that, when a php script ends there'll be no more connection. But maybe this is managed by the special servers/extensions like Meteor. In fact, if you're going to deploy your php script as a CLI on a server that's another story. – CoolStraw Mar 27 '11 at 22:17
-
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.
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.