【问题标题】:The request was missing an Authentification Key FCM Token请求缺少身份验证密钥 FCM 令牌
【发布时间】:2017-04-05 22:20:29
【问题描述】:

我正在尝试使用 postman firebase url 进行访问,但它给了我错误。 我已经设置了所有的东西,但它仍然给我错误

这是我在邮递员上遇到的错误

<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\"}}"

【问题讨论】:

    标签: ruby-on-rails ruby ruby-on-rails-4 firebase firebase-cloud-messaging


    【解决方案1】:

    您需要先在 Header 中做的所有事情
    授权: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"}}
    

    编辑 对于任何困惑,请按照我的教程 how to integrate firebase with ruby on rails

    【讨论】:

    • 我在 Postman 中收到相同的消息,并且我有授权:key=(这是显示在云消息选项卡中的 FCM 令牌)
    • 这在文档中给出并且不起作用,有人得到解决方案吗?
    • 它工作正常我可以知道你哪里出错了吗?
    【解决方案2】:

    在标题下,授权:key=AAAA.....

    必须在 Firebase 服务器密钥令牌前面添加“key=”!!!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-12-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-20
      • 1970-01-01
      • 2019-02-21
      • 2016-02-29
      相关资源
      最近更新 更多