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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With