Now it’s already a week that I’m looking for answers to the problem that I have, but I can’t find anything, so I'm going to ask a question here!
I made an iPhone app that can send notifications to users. So I have a PHP encoded notification server that uses apns-php (http://code.google.com/p/apns-php/)
My server can send notifications at any time, so I have a worker who works unlimited, and every time he receives a notification to be sent (notifications are sent to the queue), he sends a notification. To be as fast as possible, the worker has 10 threads that can send notifications.
When I start the worker, I get notifications that I think I should receive.
The problem is that after a while (I don’t know if it was after a certain amount of time or a certain number of notifications sent ... or something else!), I do not receive any new notifications. And when I look at the apns-php logs, there is nothing: all messages seem to be sent to the APNS service, without errors (apns-php uses the extended format). As soon as I restart the worker, I again receive notifications (but only for a while).
I searched for this problem on stackoverflow and google, and so far the only answers I've seen were:
- The problem is with the certificate / profile used. I know that this is not a problem, because I get notifications when the worker starts
- There are some development device tokens in our database that force APNS to close the connection. In fact, it is possible that some development tokens are present in our database, but when I look at the apns-php code, if the connection is closed, a new one opens. Therefore, I do not understand how this can affect all notifications sent after a bad device token.
This problem really drives me crazy, because notifications are really important for our service. Therefore, if someone has an idea of what might be the problem here, it really will be a life saver!
PS: I did not post any code because there is nothing specific that I am doing. I just use the send () function apns-php for every notification sent.
source share