2
我們使用chcm的gcm進行擴展。我們得到了Oauth,如「ya29。* *」,並將此擴展用於開發儀表板。用於chrome 403的GCM forbbiden錯誤
我們的服務器請求發送消息到gcm並得到這個錯誤。
爲什麼鉻的gcm返回此錯誤?
{
"error": {
"errors": [
{
"domain": "gcmForChrome.message",
"reason": "forbiddenForNonAppOwner",
"message": "A message can only be sent by the owner of the app."
}
],
"code": 403,
"message": "A message can only be sent by the owner of the app."
}
我們的服務器請求是這樣的。
curl_setopt($ch, CURLOPT_URL,'https://www.googleapis.com/gcm_for_chrome/v1/messages');
curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS,json_encode($arr));
謝謝。
感謝您的回答,但由於此錯誤我們無法發佈。 [link](http://productforums.google.com/forum/#!topic/chrome/pkmiFvCypks) –