sandysandeep441 / apns-php

Automatically exported from code.google.com/p/apns-php
0 stars 0 forks source link

Unable to disconnect from APNS-PHP server object? #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Using the sample code in sample_server.php, I am able to connect to APNS/send 
out notifications just fine. However, how might I go about implementing this 
code into a script that runs on a scheduled basis, then disconnects when it's 
finished sending out alerts? As the sample code stands, it forks the server, 
but then the script never seems to terminate (when running from the command 
line). Thanks in advance for your help; this is a great project!

Original issue reported on code.google.com by mchatter...@gmail.com on 24 Aug 2010 at 9:10

GoogleCodeExporter commented 8 years ago
The server should run continually. You have 2 ways to "talk" with your server: 
a simple way and a more complex way.

The second one: you could listen from the server on a TCP port (or via socket) 
and use a custom protocol to "send" or better queue new push notifications.

The first one: you can "poll" a directory and check for file in this dir. In 
every file you can store a "push" notification; when you find a new file you 
should read the content and delete that file. Now your server can send this 
push notification.

Ciao,

Aldo

Original comment by aldo.arm...@gmail.com on 25 Aug 2010 at 3:31