Google CCS (GCM) - project not whitelisted

旧巷老猫 提交于 2019-11-27 16:26:44

问题


I'm trying to get the Python code working that I found on: http://developer.android.com/google/gcm/ccs.html I've change the first 2 rows with (I think) the correct data. The projectnr and api key is fake, it's just to show you how it almost looks.

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

I've created a google api project (tried it with 2 different projects). Activated GCM. Copied the following: Project Number: 489713985816 API key : AIzd237jjN_iT7yRxLWiHRreqax45XaMJQ6VJ98 Tried the code with a Key for server, and a key for browser apps, both with and without a specific IP address.

When I execute the code with #python ccs.py I get the following result: If this is my problem, how do I get my project whitelisted?

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!

回答1:


you might wan't to try the following guide http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/

I was having the same problem that you are but following this guide has helped me get my push notifications through without having to sign up to be whitelisted.




回答2:


After 3 months of waiting, I've just received an email from a Google employee. My GCM whitelist request has been approved. Thank you Ashish. Now, let the fun begin!




回答3:


In the documentation, it is mentioned several times that to use Up-stream messaging, you need to ask authorization (be whitelisted).

You can do that here: https://services.google.com/fb/forms/gcm/

You can still use the old "Cloud to device" messaging. You can read more about this, including links to a sample project here.



来源:https://stackoverflow.com/questions/16628741/google-ccs-gcm-project-not-whitelisted

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!