我试图让我找到的Python代码工作: http://developer.android.com/google/gcm/ccs.html 我已经改变了前两行(我认为)正确的数据。 projectnr和api键是假的,只是为了向你展示它的外观。谷歌CCS(GCM) - 项目未列入白名单
import sys, json, xmpp
SERVER = ('gcm.googleapis.com', 5235)
USERNAME = '489713985816'
PASSWORD = 'AIzd237jjN_iT7yRxLWiHRreqax45XaMJQ6VJ98'
我创建了一个google api项目(尝试过2个不同的项目)。 激活的GCM。 复制以下: 项目编号:489713985816 API密钥:AIzd237jjN_iT7yRxLWiHRreqax45XaMJQ6VJ98 试图与服务器密钥,并为浏览器的应用程序的关键,既没有一个特定的IP地址的代码。
当我使用#python ccs.py执行代码时,得到以下结果: 如果这是我的问题,我该如何将我的项目列入白名单?
Invalid debugflag given: socket
DEBUG:
DEBUG: Debug created for /usr/lib/python2.7/dist-packages/xmpp/client.py
DEBUG: flags defined: socket
DEBUG: socket start Plugging <xmpp.transports.TCPsocket instance at 0x1ea2950>
into <xmpp.client.Client instance at 0x1ea27a0>
DEBUG: socket start Successfully connected to remote
host ('gcm.googleapis.com', 5235)
DEBUG: socket sent <?xml version='1.0'?>
<stream:stream xmlns="jabber:client" to="gcm.googleapis.com" version="1.0"
xmlns:stream="http://etherx.jabber.org/streams" >
DEBUG: socket got
<stream:stream from="gcm.googleapis.com" id="FD82304ADA8C8019" version="1.0"
xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client">
<stream:features>
<mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
<mechanism>X-OAUTH2</mechanism>
<mechanism>X-GOOGLE-TOKEN</mechanism>
<mechanism>PLAIN</mechanism>
</mechanisms>
</stream:features>
DEBUG: socket sent <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl"
mechanism="PLAIN">MjgzMVqTl9p\nVDdUTZWSjk4\n</auth>
DEBUG: socket got <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
<temporary-auth-failure/>
<text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">
Project 489713985816 not whitelisted.</text>
</failure>
</stream:stream>
Authentication failed!
我想我知道为什么我得到了“项目未列入白名单”。 该服务未向公众开放,您必须先注册:https://services.google.com/fb/forms/gcm/准备就绪后,我已注册并更新此故障单。 – Gaston
还好吗?我有兴趣了解批准新服务器需要多长时间。新的Google Cloud PHP托管服务在24小时内批准了我的请求。 – simbolo
10天后未收到批准。 – Gaston