Pythonコードを見つけようとしています: http://developer.android.com/google/gcm/ccs.html 正しいデータで最初の2行を変更しました。 projectnrとapiの鍵は偽物ですが、見た目がどのようになっているかを示すだけです。Google 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