This is what I wrote to get it and attempt to send a push notification:
<?php
//send FCM notification
$fcmToken = "My device token";
$fcmKey = "My Firebase Cloud Messaging Server Key";
//I tried curl like this but I barely understand it and it wouldn't work
//curl -X POST --header "Authorization: key=$fcmKey" --Header "Content-Type: application/json" https://fcm.googleapis.com/fcm/send -d "{\"to\":\"$fcmToken\",\"notification\":{\"body\":\"Yellow\"},\"priority\":10}"
echo "starting curl <hr>";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "https://fcm.googleapis.com/fcm/send");
curl_setopt($curl, CURLOPT_HTTPHEADER, array("Authorization: key=$fcmKey","Content-Type: application/json","to: $fcmToken","notification:{\"body\":\"Yellow\"}","priority: 10" )); //setting custom header
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
echo "curlResult: " . $result;
curl_close($curl);
echo "<hr>curl end";
?>
The output I got was like this, why?:
starting curl <hr>curlResult: <HTML>
<HEAD>
<TITLE>Moved Temporarily</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Moved Temporarily</H1>
The document has moved <A HREF="https://firebase.google.com/docs/cloud-messaging/http-server-ref">here</A>.
</BODY>
</HTML>
<hr>curl end
Thanks in advance for any help!