擅长:python、mysql、java
<p>当然可以。GCM有一个JSON restapi,您可以针对它工作。首先,您需要在这里注册您的项目:<a href="http://developer.android.com/google/gcm/gs.html" rel="nofollow noreferrer">http://developer.android.com/google/gcm/gs.html</a>。在</p>
<p>你基本上是这样做的:</p>
<ol>
<li>从<a href="http://developer.android.com/google/gcm/gs.html#access-key" rel="nofollow noreferrer">http://developer.android.com/google/gcm/gs.html#access-key</a>获取API密钥</li>
<li>构建你的有效负载,一个包含注册ID、数据等的dict</li>
<li>使用url.fetch<a href="https://developers.google.com/appengine/docs/python/urlfetch/" rel="nofollow noreferrer">https://developers.google.com/appengine/docs/python/urlfetch/</a>将数据作为JSON字符串发送到gcmapi</li>
</ol>
<p>这是另一个有代码的问题。<a href="https://stackoverflow.com/questions/11697096/google-cloud-messaging-http-error-400-bad-request">Google Cloud Messaging HTTP Error 400: Bad Request</a>和一篇博客(不是英语,我想是西班牙语。但是这里有一些示例代码)<a href="http://pforray.wordpress.com/2012/07/05/ejemplo-gcm-en-appengine-python/" rel="nofollow noreferrer">http://pforray.wordpress.com/2012/07/05/ejemplo-gcm-en-appengine-python/</a></p>