Can't send Messages to Apple Push Notification Server

huailin

Registered
Aug 20, 2011
1
0
51
Folks,

Pls help if you happen had this issue before.

I migrated my system yesterday, and uploaded all the files. When testing, realized that the my php codes could NOT send ssl-sockets messages to Apple Push server. It worked perfect on my local server here. Does Apple remember my local server IP when i register the Push Notification service? I did not remember they did this.

$apnsHost = 'gateway.sandbox.push.apple.com';
b$apnsPort = 2195;
$apnsCert = 'apns-dev.pem';

$streamContext = stream_context_create();
stream_context_set_option($streamContext, 'ssl', 'local_cert', $apnsCert);

$apns = stream_socket_client('ssl://' . $apnsHost . ':' . $apnsPort, $error, $errorString, 2, STREAM_CLIENT_CONNECT, $streamContext);