It's actually possible using the firebase rest api, the following endpoint could be used to send a notification:
https://fcm.googleapis.com/fcm/send
The HTTP request must be a POST request with these headers:
Authorization: key=<server_key>
Content-Type: application/json
and the following body:
{
"to" : "<FCM TOKEN>",
"collapse_key" : "type_a",
"priority": 10,
"data" : {
"body" : "Notification",
"title": "Notification title"
}
}
Of course you need to know to the FCM token of the target device that should receive the notification or at least the topic where the device/user is subscribed to. If you want to send notification to a specific topic use the following body:
{
"to" : "/topics/<YOUR_TOPIC>",
"collapse_key" : "type_a",
"priority": 10,
"data" : {
"body" : "Notification",
"title": "Notification title"
}
}