title: Push notifications work for development, not production
body: <p>I have been trying for the past how long to figure out how to go from the sandbox APNS to production APNS. Below is the PHP code used to send notifications to my app.</p>
  
  <pre><code>$passphrase = 'SomethingStrong';
  
  $ctx = stream_context_create();
  stream_context_set_option($ctx, 'ssl', 'local_cert', $_SERVER['DOCUMENT_ROOT'] . '/ck.pem');
  stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase);
  
  $fp = stream_socket_client(
      'ssl://gateway.sandbox.push.apple.com:2195', $err,
      $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);
  
  if (!$fp)
  {
      //return json_encode(array('response' =&gt; 'connection_fail'));
  }
  
  $body['aps'] = array(
      'alert' =&gt; $message,
      'sound' =&gt; 'default'
      );
  
  $payload    = json_encode($body);
  $msg        = chr(0) . pack('n', 32) . pack('H*', $deviceToken) . pack('n', strlen($payload)) . $payload;
  
  $result     = fwrite($fp, $msg, strlen($msg));
  
  if (!$result)
      return json_encode(array('response' =&gt; 'unsuccessful'));
  else
      return json_encode(array('response' =&gt; 'successful'));
  
  fclose($fp);
  </code></pre>
  
  <p>This whole thing works when I keep the URL <code>ssl://gateway.sandbox.push.apple.com:2195</code>, but when I when I change it to <code>ssl://gateway.push.apple.com:2195</code> no notifications come through my app, yet PHP outputs that it was sent successfully.</p>
  
  <p>I'm code-signing with the development certificates.</p>
  
  <p>I'm new to notifications and have never used them before, so sorry if I'm doing something really obvious. Thanks.</p>