该请求缺少Authentification Key FCM Token

ank*_*kur 7 ruby ruby-on-rails firebase ruby-on-rails-4 firebase-cloud-messaging

我试图使用postman firebase网址,但它给了我错误.我已经设置了所有的东西,但它仍然给我错误

这是我对邮递员的错误

<HTML>
    <HEAD>
        <TITLE>The request was missing an Authentification Key (FCM Token). Please, refer to section &quot;Authentification&quot; of the FCM documentation, at https://firebase.google.com/docs/cloud-messaging/server.</TITLE>
    </HEAD>
    <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
        <H1>The request was missing an Authentification Key (FCM Token). Please, refer to section &quot;Authentification&quot; of the FCM documentation, at https://firebase.google.com/docs/cloud-messaging/server.</H1>
        <H2>Error 401</H2>
    </BODY>
</HTML>


These things I am adding <br/>
url = 'https://fcm.googleapis.com/fcm/send'<br/>
method = POST<br/>
Headers <br/>
Authorization = 'FIREBASE_SERVER_API_KEY'<br/>
Content-Type = application/json<br/>
Body = 
"{"registration_ids":["ids"],"priority":"high\",\"data\":{\"notification_id\":76,\"title\":\"dvxcv\",\"description\":\"xcvxv\",\"image\":\"/uploads/image/image/37513/Screenshot_from_2016-10-17_10_43_59.png\"}}"
Run Code Online (Sandbox Code Playgroud)

Ani*_*ari 4

您首先需要在标头
授权中执行以下操作:key='FIREBASE_SERVER_API_KEY'

并且您在 json 解析时遇到问题,必须删除“/”

{"registration_ids":["ids"],"priority":"high","data":{"notification_id":76,"title":"dvxcv","description":"xcvxv","image":"/uploads/image/image/37513/Screenshot_from_2016-10-17_10_43_59.png"}}
Run Code Online (Sandbox Code Playgroud)

编辑如有任何困惑,请按照我的教程 如何将 firebase 与 ruby​​ on Rails 集成