Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can't send Messages to Apple Push Notification Server

Discussion in 'General Discussion' started by huailin, Aug 20, 2011.

  1. huailin

    huailin Registered

    Aug 20, 2011
    Likes Received:
    Trophy Points:

    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 = '';
    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);

Share This Page