Having trouble with Push Notifications

I followed all the steps described in the blog post (some of them multiple times)
http://www.coronalabs.com/blog/2011/12/21/push-notifications-for-ios-in-corona-sdk/

When I exec the php script in the terminal on my Mac it gives the expected output:

Connected to APNS
Message successfully delivered

But it doesn’t seem to deliver any notification to the app installed on my device. I’ve double-checked the device token and run out of ideas. Any ideas what might be going wrong?

Also, when I copy the same php script to a webserver and invoke it through a web browser, I get the following error:

Warning: stream_socket_client() [function.stream-socket-client]: unable to connect to ssl://gateway.sandbox.push.apple.com:2195 (Connection refused) in test-push.php on line 21
Failed to connect: 111 Connection refused

The line it is complaining about is:

18 // Open a connection to the APNS server  
19 $fp = stream\_socket\_client(  
20 'ssl://gateway.sandbox.push.apple.com:2195', $err,  
21 $errstr, 60, STREAM\_CLIENT\_CONNECT|STREAM\_CLIENT\_PERSISTENT, $ctx);  

Any help greatly appreciated. This is an arcane part of the iPhone dev process and I’m stumped.

cheers

Ollie [import]uid: 131885 topic_id: 29616 reply_id: 329616[/import]

This was a while ago so hopefully you figured it out. My best guess would be that there was a missing or incorrect .pem file.

Also you’ve only given us a tiny snippet of code, so possibly the code below was missing before line 18?

$ctx = stream\_context\_create(); stream\_context\_set\_option($ctx, 'ssl', 'local\_cert', 'ck.pem'); stream\_context\_set\_option($ctx, 'ssl', 'passphrase', $passphrase); [import]uid: 84115 topic_id: 29616 reply_id: 128424[/import]

This was a while ago so hopefully you figured it out. My best guess would be that there was a missing or incorrect .pem file.

Also you’ve only given us a tiny snippet of code, so possibly the code below was missing before line 18?

$ctx = stream\_context\_create(); stream\_context\_set\_option($ctx, 'ssl', 'local\_cert', 'ck.pem'); stream\_context\_set\_option($ctx, 'ssl', 'passphrase', $passphrase); [import]uid: 84115 topic_id: 29616 reply_id: 128424[/import]