How to successfully “Generate a Notification Key on the Client”?

25 views
Skip to first unread message

pushbit

unread,
Feb 25, 2015, 5:02:10 AM2/25/15
to andro...@googlegroups.com
I'm following the below instructions, but the response is always HTTP 401 Unauthorized. I have verified that the ID token, registration ID, and project ID (number) are all valid. Unfortunately the response does not provide a detailed reason.


What is necessary to receive an HTTP 200 response with the notification_key? I'm wondering if the documentation is missing an important detail or if there is a known issue with the service. Otherwise GCM and the Google auth token are working fine for me.  It seems that the id_token field is not being used by the service. If I remove any other field, the response is {"error":"Missing \"{field-name}\" field"}. But it doesn't return a similar response when id_token is missing.

Here is a redacted net log. Does the request require any other headers or JSON fields that are not specified in the documentation?

project_id: {project-number}
Content-Type: application/json; charset=UTF-8
{"id_token":"{long-auth-token}",
"notification_key_name":"{unique-name}",
"operation":"add",
"registration_ids":["{reg-id}"]}

Reply all
Reply to author
Forward
0 new messages