dregvw1801 2017-04-18 08:34
浏览 128
已采纳

尝试恢复丢失的组通知密钥时Firebase无效的项目ID

While testing my server-side php functions to create device groups i lost track of the notification key returned as a result of successfully creating a device group.

As described in https://groups.google.com/forum/#!topic/firebase-talk/ytovugx8XNs i tried

curl -v  -H Content-Type:application/json -H Authorization:key=<your api key> 
-H project_id:<your project id> 
https://android.googleapis.com/gcm/notification?notification_key_name=testgroup

where the project id is the one found in firebase console, the same shown in the url and the very same present even in my google-services.json

As a result i get

HTTP/1.1 400 Bad Request Content-Type: application/json; charset=UTF-8 Date: Tue, 18 Apr 2017 08:21:30 GMT Expires: Tue, 18 Apr 2017 08:21:30 GMT Cache-Control: private, max-age=0 X-Content-Type-Options: nosniff X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block Server: GSE Alt-Svc: quic=":443"; ma=2592000; v="37,36,35" Accept-Ranges: none Vary: Accept-Encoding Transfer-Encoding: chunked
* Curl_http_done: called premature == 0 * Connection #0 to host android.googleapis.com left intact {"error":"INVALID_PROJECT_ID"}

I can't find a way out of this, since after losing a notification key the only way to recover it is with that command (afaik) . Please help.

  • 写回答

1条回答 默认 最新

  • doushan7997 2017-04-18 08:50
    关注

    The Project ID that should be used for FCM is the Sender ID. This value can be seen in the Firebase Console > Settings > Cloud Messaging Tab.

    If you refer to the google-services.json file, the value for project_number should be the one you use (same value as seen from the Firebase Console). It's a numerical-only value.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型