title: Google GCM server returns Unauthorized Error 401
body: <p>I am using GCM services to push information from server. If I use browser key it shows the sucess mesaage as : <strong>{"multicast_id":4849013215736515938,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1348742583011905%2adac3a0f9fd7ecd"}]}</strong>
  but i did not get any notifications on device. 
  And if I use server key it shows <strong>Unauthorized Error 401</strong>. My code is shown below:</p>
  
  <pre><code>$apiKey = "xxxxx";
  $registrationIDs = array("xxxxxxxx");
  $message = "testing Process";
  $url = 'https://android.googleapis.com/gcm/send';
  $fields = array(
          'registration_ids'  =&gt; $registrationIDs,
          'data'              =&gt; array("message"=&gt;$message),
          );
  $headers = array( 
          'Authorization: key=' . $apiKey,
          'Content-Type: application/json'
          );
  $ch = curl_init();
  curl_setopt( $ch, CURLOPT_URL, $url );
  curl_setopt( $ch, CURLOPT_POST, true );
  curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
  curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
  curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
  curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0); 
  curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode($fields) );
  
  $result = curl_exec($ch);
  if(curl_errno($ch)){ echo 'Curl error: ' . curl_error($ch); }
  curl_close($ch);
  echo $result;
  </code></pre>
  
  <p>Please help me for this issue. Thanks in advance.</p>