FCM-通过curl从PC向android发送消息

时间:2019-03-15 02:49:01

标签: firebase-cloud-messaging

我希望通过curl命令从PC向Android发送FCM消息:

curl -H "Content-Type:application/json" \
         -H "Authorization: key=<server-key>" \
         -d '{
  "to":"<android-token>"
      "notification": {
      "title":"Title of your notification",
      "body":"content of your notification"
  },
  "data": {
    "key1" : "value1",
    "key2" : "value2",
  }
}' \
https://android.googleapis.com/gcm/send 

但是我总是得到以下错误响应:

{"multicast_id":7901710007279559415,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"MismatchSenderId"}]}

通过命令行发送FCM消息是否正确?

0 个答案:

没有答案