Send Push Notification Via Firebase By Postman
If you want to send push notification from your server using the firebase console, first you can check it is working or not in Postman. you have entered this Url ( https://fcm.googleapis.com/fcm/send), then add the headers to it.
1 Content-Type = application/json
2 Authorization key = your server key or default key. For more information check the screenshot
There two ways to send the push notification
Note:-
- iOS users receive notifications if it contains “notification” key and android users will receive notification for both notification and data key.
- iOS users will receive background notification if it contains both key value pair “content_available” : true and “priority” : “high”
- For iOS notification must contain keys title and body to receive notification
To send push notification to a single user. you have to add this sample content to payload body.
{
“to” : “device token generated by the firebase”,
“notification” : {
“body” : “great match!”,
“title” : “Portugal vs. Denmark”
“content_available” : true,
“priority” : “high”,
},
“data” : {
“body” : “great match!”,
“title” : “Portugal vs. Denmark”
“content_available” : true,
“priority” : “high”,
}
}