<?php
$fcmToken = ['cFlXEwr4Y07ikw14-QuIHJ:APA91bE54mrOpFyzDSq7NfFnYqPXrA2B4mXrqFYlxaVphIsFvHiMEt4lHypW-IYmfZT1F41c-3ke-7rtDZSI_RVsioIkk2krlr4DSZrY1cor2hz2TBo9CJoleriKeB8OzxLzDxhjqj2L'];
$title = "Test Push notification";
$body = "This is test Push notification";
$url = 'https://f...content-available-to-author-only...s.com/fcm/send';
// $serverKey = env('FCM_SERVER_KEY');
$serverKey = "AAAAmgAHb2U:APA91bGbQXS7Ptwo7gvFXqp0I11z9SbUslgOm62co6TPd4BuxY2NDUkAawNR6l4r9j69A7wVJldgxPe2y5tSzbFNl-lD8kdqeNgzT8vus5vRa8s956d_7VYO6sCVqyIS0ctEj0rIJSc1";
$data = [
"registration_ids" => $fcmToken,
"notification" => [
"title" => $title,
"body" => $body,
]
];
$headers = [
'Authorization:key=' . $serverKey,
'Content-Type: application/json',
];
curl_setopt($ch, CURLOPT_HTTP_VERSION
, CURL_HTTP_VERSION_1_1
); // Disabling SSL Certificate support temporarly
// Execute post
echo $result ? "results" : "false";
if ($result === FALSE) {
echo "false output";
return false;
}
// Close connection
// FCM response
return true;
?>
PD9waHAKJGZjbVRva2VuID0gWydjRmxYRXdyNFkwN2lrdzE0LVF1SUhKOkFQQTkxYkU1NG1yT3BGeXpEU3E3TmZGbllxUFhyQTJCNG1YcnFGWWx4YVZwaElzRnZIaU1FdDRsSHlwVy1JWW1mWlQxRjQxYy0za2UtN3J0RFpTSV9SVnNpb0lrazJrcmxyNERTWnJZMWNvcjJoejJUQm85Q0pvbGVyaUtlQjhPenhMekR4aGpxajJMJ107CiR0aXRsZSA9ICJUZXN0IFB1c2ggbm90aWZpY2F0aW9uIjsKJGJvZHkgPSAiVGhpcyBpcyB0ZXN0IFB1c2ggbm90aWZpY2F0aW9uIjsKICR1cmwgPSAnaHR0cHM6Ly9mLi4uY29udGVudC1hdmFpbGFibGUtdG8tYXV0aG9yLW9ubHkuLi5zLmNvb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