title: GCM non-collapsible message always replaces the previous message
body: <p>I'm trying to send a non-collapse message via Google Cloud Messaging. For some reason a new message always replaces the previous one. I've tried to use different collapse-keys with no effect. Also omitting the collapse key does not work. What could be the problem?</p>
  
  <p>This is an example code:</p>
  
  <pre><code>&lt;?php
  $ids[] = '&lt;notification registration id of the test phone&gt;';
  sendNotification($ids, "test message 1", "key1");
  sendNotification($ids, "test message 2", "key2");
  
  function sendNotification($ids, $message, $collapseKey)
  {
    $apiKey = '&lt;api key here&gt;';
    $url = 'https://android.googleapis.com/gcm/send';
  
    $data['title'] = 'AppName';
    $data['message'] = $message;
  
    $post['registration_ids'] = $ids;
    $post['data'] = $data;
    if ($collapseKey) {
      $post['collapse_key'] = $collapseKey;
    }
  
    $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_POSTFIELDS, json_encode( $post ) );
    $result = curl_exec( $ch );
    if ( curl_errno( $ch ) )
    {
        echo 'GCM error: ' . curl_error( $ch );
    }
    curl_close( $ch );
  
    echo $result;
  }
  ?&gt;
  </code></pre>