0

I am using PHP code from as many various web sites as possible, after having written my own, and everything fails with connection to the apple push notification feedback service.

In a nutshell:

$stream_context = stream_context_create();


stream_context_set_option($stream_context, 'ssl', 'local_cert', $certkeypath);      

stream_context_set_option($stream_context, 'ssl', 'passphrase', $pass);

$apns = stream_socket_client('ssl://feedback.sandbox.push.apple.com:2196', $errcode, $errstr, 60, STREAM_CLIENT_CONNECT, $stream_context);

if(!$apns) {
 echo "ERROR $errcode: $errstr\n";
 return;
}

The above code times out 100% of all connection requests tonight. BUT! If the address is changed from feedback.sandbox.push.apple.com to gateway.sandbox.push.apple.com, and the port is changed from 2196 to 2195, then everything works 100%, all push notifications are delivered. I deleted the app from one of my devices and continued sending it push notifications, so I have been expecting real results from feedback, but nothing.

So is there a reason why the gateway works but feedback doesn't, it seems the only difference is the port and address. Possibly the flags, but I'm using code other people claim works.

Makes me think the APNs feedback service is down for maintenance.

Tom Pace
  • 2,347
  • 1
  • 24
  • 32
  • 1
    Some people claimed that the feedback service doesn't work for the sandbox environment, but that was two years ago, so I'm not sure if it's still relevant. There are also some suggestions how to solve the problem : [link](http://stackoverflow.com/questions/2246187/testing-apple-push-notifications-feedback-no-items-received) All I can say is that for the production environment the feedback service worked for me yesterday. – Eran Nov 01 '12 at 21:20
  • Thanks for posting that, I appreciate it. – Tom Pace Nov 19 '12 at 06:43
  • I solved this problem today! So I answered my own question, it was a firewall on the web server. Opened port 2196, and instantly a new test connected and returned. – Tom Pace Nov 20 '12 at 06:16

1 Answers1

0

Now 3 weeks later, an idea: could be a firewall?

Sure enough, it was.

Now, I can read the APNs Feedback without timeouts. :D

Tom Pace
  • 2,347
  • 1
  • 24
  • 32