Błąd autoryzacji GCM http 401

Kiedy mój serwer wysyłający wysyła żądania do serwerów GCM, otrzymuję błąd autoryzacji HTTP 401.

Postępowałem według kroków opisanych tutaj:

http://developer.android.com/google/gcm/http.html#auth_error

>> api_key=AIzaSyDEy3...

>> curl --header "Authorization: key=$api_key" --header Content-Type:"application/json" https://android.googleapis.com/gcm/send  -d "{\"registration_id\":\"ABC\"}"

Rozumiem:

<HTML>
<HEAD>
<TITLE>Unauthorized</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Unauthorized</H1>
<H2>Error 401</H2>
</BODY>
</HTML>

W rozwiązywaniu problemów mówi:

Authentication Error
The sender account that you're trying to use to send a message couldn't be authenticated. Possible causes are:
    1. Authorization header missing or with invalid syntax.
    2. Invalid project number sent as key.
    3. Key valid but with GCM service disabled.
    4. Request originated from a server not whitelisted in the Server Key IPs.

Mam pytania na ten temat:

Czy nagłówek w żądaniu curl jest prawidłowy?Czy mają na myśli „api_key” (AIzaSy…) lub numer projektu, taki jak 8305134…?Jak dodać białą listę adresów IP kluczy serwera?Jeśli korzystam z polecenia curl, czy muszę dodać białą listę adresów IP mojego komputera?

questionAnswers(14)

yourAnswerToTheQuestion