Send Firebase push notifications using Postman.

Prabhanu Gunaweera
2 min readApr 20, 2020

--

Before starting my article, It would be better to mention that I am not going to discuss about how to implement and set up the Firebase push notifications here. I am going to discuss only push notification testing using Postman.

First, follow the below steps to set up Postman to send Firebase notifications.

  1. Enter https://fcm.googleapis.com/fcm/send URL and select POST method.
  2. Add Authorization and Content-Type headers.
  • Authorization — key = “server key”
  • Content-Type — application/json

(to find server key Go to your firebase console and select your Firebase Project, Click on Settings icon >Project Settings > Cloud Messaging > Server Key )

3. Add the following as your Body

{
"to":"fcm token",
"notification" : {
"sound" : "default",
"body" : "test body",
"title" : "test title",
"content_available" : true,
"priority" : "high"
},
"data" : {
"sound" : "default",
"body" : "test body",
"title" : "test title",
"content_available" : true,
"priority" : "high"
}
}

4. Press Send button

After following these steps, you can send push notifications and find out whether the Firebase push notifications are working for you or not 😊

Here is the cURL code snippet for the above process.

curl --location --request POST 'https://fcm.googleapis.com/fcm/send' \
--header 'Authorization: key=SERVER_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"to":"FCM_TOKEN",
"notification" : {
"sound" : "default",
"body" : "test body",
"title" : "test title",
"content_available" : true,
"priority" : "high"
},
"data" : {
"sound" : "default",
"body" : "test body",
"title" : "test title",
"content_available" : true,
"priority" : "high"
}
}'

Thanks for reading…

--

--

Prabhanu Gunaweera
Prabhanu Gunaweera

Written by Prabhanu Gunaweera

Engineer | Tech blogger | Flutter consultant CHECKOUT - www.prabhanu.com

No responses yet