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
  • 565,676
  • 79
  • 828
  • 807

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,431
  • 18
  • 59
  • 84
AL.
  • 36,815
  • 10
  • 142
  • 281