I send notifications in my server with PHP to FCM with this function:
function sendGCM($ch1,$ch2, $message) {
$url = 'https://fcm.googleapis.com/fcm/send';
$fields = array (
'to' => $ch1
,
'data' => array (
"message" => $message
)
);
$fields = json_encode ( $fields );
$headers = array (
'Authorization: key=' . $appID,
'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, $fields );
$result = curl_exec ( $ch );
curl_close ( $ch );
echo $result;
}
The response is this {"message_id":9191006033691432523}
. In the documentation, https://firebase.google.com/docs/cloud-messaging/http-server-ref multicast_id, success, failure parameters are required in the response but.
What is the reason for this?