はい、できます。
<?php
$ch = curl_init("https://fcm.googleapis.com/fcm/send");
//The device token.
$token = "device_token_here";
//Title of the Notification.
$title = "The North Remembers";
//Body of the Notification.
$body = "Bear island knows no king but the king in the north, whose name is stark.";
//Creating the notification array.
$notification = array('title' =>$title , 'body' => $body);
//This array contains, the token and the notification. The 'to' attribute stores the token.
$arrayToSend = array('to' => $token, 'notification' => $notification);
//Generating JSON encoded string form the above array.
$json = json_encode($arrayToSend);
//Setup headers:
$headers = array();
$headers[] = 'Content-Type: application/json';
$headers[] = 'Authorization: key= your_server_key_here';
//Setup curl, add headers and post parameters.
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);
//Send the request
curl_exec($ch);
//Close request
curl_close($ch);
?>
:
Project Settings -> Cloud Messaging Tab -> Copy the Server key.
今
2)、ここでは特定のデバイスに通知を送信するためのサンプルのPHPスクリプトは次のとおりです。
1)まず、あなたのfirebaseプロジェクトのサーバーキーを取得実行上の
3)出力:
{"multicast_id":8XXXD,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:14XX"}]}
あなたは文書を読んでいますか? https://firebase.google.com/docs/cloud-messaging/downstream#sending_topic_messages_from_the_server – tyczj