title: Field "to" must be a JSON string [Firebase]
body: <p>I'm trying to send notification using a cron job. I migrated from GCM to FCM. In my server side, I changed <code>https://android.googleapis.com/gcm/send to https://fcm.googleapis.com/fcm/send</code> and also updated on how to request the data changing <code>registration_ids</code> to <code>to</code>. Checking the json passed it is a valid json but I'm having an error <code>Field "to" must be a JSON string</code>. Is there anyway to solve this? </p>
  
  <p>Here is my code </p>
  
  <pre><code>function sendNotificationFCM($apiKey, $registrationIDs, $messageText,$id) {
  
  
      $headers = array(
              'Content-Type:application/json',
              'Authorization:key=' . $apiKey
      );
  
      $message = array(
              'to' =&gt; $registrationIDs,
              'data' =&gt; array(
                      "message" =&gt; $messageText,
                      "id" =&gt; $id,
              ),
      );
  
  
      $ch = curl_init();
  
      curl_setopt_array($ch, array(
              CURLOPT_URL =&gt; 'https://fcm.googleapis.com/fcm/send',
              CURLOPT_HTTPHEADER =&gt; $headers,
              CURLOPT_POST =&gt; true,
              CURLOPT_RETURNTRANSFER =&gt; true,
              CURLOPT_POSTFIELDS =&gt; json_encode($message)
      ));
  
      $response = curl_exec($ch);
      curl_close($ch);
  
      return $response;
  }
  </code></pre>