I'm trying to run the GCM demo. I've built and installed the app on my phone and now am trying to fire the POST to activate the push.
I generated the google-services.json file and during that process got a server key (API_KEY) and a Sender ID (SID). (Is the sender ID the 'to' device/app token?)
I'm trying to send with this post:
curl -vvv -X POST --header "Content-Type: application/json" --header "project_id: default-demo-app-92a8c" --header "Authorization: key=<<API_KEY>>" --data @- "https://android.googleapis.com/gcm/send" << EOF
{
"to": "<<SID>>",
"data": {
"message":"Hello"
}
}
EOF
This is the response:
* Trying 74.125.29.95...
* Connected to android.googleapis.com (74.125.29.95) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate: *.googleapis.com
* Server certificate: Google Internet Authority G2
* Server certificate: GeoTrust Global CA
> POST /gcm/send HTTP/1.1
> Host: android.googleapis.com
> User-Agent: curl/7.43.0
> Accept: */*
> Content-Type: application/json
> project_id: default-demo-app-92a8c
> Authorization: key=AIzaSyA2GFGsoIeppqKRTpSc6m4sffGD8dzqryY
> Content-Length: 58
>
* upload completely sent off: 58 out of 58 bytes
< HTTP/1.1 400 Bad Request
< Content-Type: text/plain; charset=UTF-8
< Date: Tue, 26 Jan 2016 21:46:48 GMT
< Expires: Tue, 26 Jan 2016 21:46:48 GMT
< Cache-Control: private, max-age=0
< X-Content-Type-Options: nosniff
< X-Frame-Options: SAMEORIGIN
< X-XSS-Protection: 1; mode=block
< Server: GSE
< Alternate-Protocol: 443:quic,p=1
< Alt-Svc: quic=":443"; ma=604800; v="30,29,28,27,26,25"
< Accept-Ranges: none
< Vary: Accept-Encoding
< Transfer-Encoding: chunked
<
INVALID_REGISTRATION
* Connection #0 to host android.googleapis.com left intact
Why am I getting this error?