1

I am new on firebase and want to show notification over browser through firebase cloud messaging but problem is that i am confuse where to write this code ::

POST /fcm/send HTTP/1.1
Host: fcm.googleapis.com
Content-Type: application/json
Authorization: key=YOUR_SERVER_KEY

{
  "notification": {
    "title": "New chat message!",
    "body": "There is a new message in FriendlyChat",
    "icon": "/images/profile_placeholder.png",
    "click_action": "http://localhost:5000"
  },
  "to":"YOUR_DEVICE_TOKEN"
}

please tell me in which file I'll have to write this code.

Any help will be appreciated.

Frank van Puffelen
  • 499,950
  • 69
  • 739
  • 734
Rishi
  • 884
  • 9
  • 18

1 Answers1

2

That's a sample payload (see parameters here). You generate a request from your own App Server or during development you could simply send downstream messages using Postman or cURL.

There's also the option of using Firebase Notifications Console.

Graham
  • 7,035
  • 17
  • 57
  • 82
AL.
  • 35,361
  • 10
  • 135
  • 270