How can I send a Firebase Cloud Messaging notification without use the Firebase Console?

后端 未结 16 1491
南旧
南旧 2020-11-22 10:17

I\'m starting with the new Google service for the notifications, Firebase Cloud Messaging.

Thanks to this code https://github.com/firebase/quickstart-a

16条回答
  •  自闭症患者
    2020-11-22 10:43

    Firebase Cloud Messaging has a server-side APIs that you can call to send messages. See https://firebase.google.com/docs/cloud-messaging/server.

    Sending a message can be as simple as using curl to call a HTTP end-point. See https://firebase.google.com/docs/cloud-messaging/server#implementing-http-connection-server-protocol

    curl -X POST --header "Authorization: key=" \
        --Header "Content-Type: application/json" \
        https://fcm.googleapis.com/fcm/send \
        -d "{\"to\":\"\",\"notification\":{\"title\":\"Hello\",\"body\":\"Yellow\"}}"
    

提交回复
热议问题