-->

谷歌CCS(GCM) - 项目未列入白名单(Google CCS (GCM) - project n

2019-09-16 04:56发布

我试图让Python代码的工作,我发现: http://developer.android.com/google/gcm/ccs.html我已经改变了前两排用(我认为)正确的数据。 该projectnr和API密钥是假的,它只是向你展示它是如何看起来几乎。

import sys, json, xmpp
SERVER = ('gcm.googleapis.com', 5235)
USERNAME = '489713985816'
PASSWORD = 'AIzd237jjN_iT7yRxLWiHRreqax45XaMJQ6VJ98'

我创建了一个谷歌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!

Answer 1:

你可能wan't尝试以下指南http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/

我有,你有同样的问题,但按照本指南帮助我通过让我的推送通知,而无需注册到白名单。



Answer 2:

3个月后等待,我刚刚收到一封电子邮件,从谷歌员工。 我的白名单GCM请求已得到批准。 谢谢阿希什。 现在,让我们的乐趣开始!



Answer 3:

在文档中,它被多次提到,要使用向上流的消息,你需要问授权(白名单)。

你可以在这里: https://services.google.com/fb/forms/gcm/

您仍然可以使用老的“云到设备”消息。 你可以阅读更多关于这一点,包括链接到这里的样本项目 。



文章来源: Google CCS (GCM) - project not whitelisted