Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
566 views
in Technique[技术] by (71.8m points)

curl - Sending Push via Postman using Firebase Messaging

I'm trying to use Postman to send a single Push Notification using Firebase Cloud Messaging service.

This is a working cURL command for the same purposal, on which I'm using as a reference.

curl -X POST --header "Authorization: key=<API_ACCESS_KEY>" --Header "Content-Type: application/json" https://fcm.googleapis.com/fcm/send -d "{"to":"<YOUR_DEVICE_ID_TOKEN>","notification":{"body":"Firebase"} "priority":"10"}"

What I have done so far..

1 - Set the Headers appropriately

enter image description here

2- At Body , I'm using raw

{
    "to" : "<YOUR_DEVICE_ID_TOKEN>"
    , 

    "notification": {
    "body": "Firebase Cloud Message"
  }

  }

When executing, I'm getting back 401 - Unauthorized.

What's missing to correctly send the push notification?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...