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.

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

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!